Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(api): log skipped prompt files - #181

Merged
Paul-Kyle merged 1 commit into
phasespace-labs:mainfrom
kudala-bharani:fix/log-skipped-prompt-files
Sep 3, 2026
Merged

fix(api): log skipped prompt files#181
Paul-Kyle merged 1 commit into
phasespace-labs:mainfrom
kudala-bharani:fix/log-skipped-prompt-files

Conversation

@kudala-bharani

@kudala-bharani kudala-bharani commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

GET /prompts silently omitted files whose reads failed, making a partial listing indistinguishable from a directory that simply contained fewer prompts.

  • Log a warning through the existing palinode.api logger with the affected path and exception, using lazy %s formatting.
  • Continue returning healthy prompts; leave activation/deactivation behavior unchanged.
  • Add a selective regression test using real prompt files, and an Unreleased changelog entry.

Closes #179

Validation

  • The new regression test fails before the fix because no warning is emitted, and passes afterward.
  • pytest tests/test_prompts.py -q --tb=short: 16 passed.
  • ruff check palinode/ tests/ scripts/: passed.
  • bandit -r palinode/ -ll: passed (no medium/high findings).
  • git diff --check: passed.
  • GitHub CI: all nine checks passed, including the unit-test jobs on Ubuntu (Python 3.11 and 3.12) and macOS (Python 3.12), plus both wheel smoke tests.

The broader local pytest run was interrupted after 637 passing tests when sandbox restrictions blocked loopback-server binds and existing subprocess tests attempted writes to the default home data directory. It was not a successful full-suite run; the CI unit-test jobs subsequently passed on all three configured platforms.

Unreadable prompts previously disappeared from listings without an explanation. Warn with the file path and error while preserving partial results, and cover the behavior with a selective regression test.
@Paul-Kyle
Paul-Kyle merged commit 6ee1103 into phasespace-labs:main Sep 3, 2026
9 checks passed
@Paul-Kyle

Copy link
Copy Markdown
Member

Merged — and welcome, this is your first here. I'm adding your name to AUTHORS.md in dev, and it will reach public with the next sync. GitHub would not accept your account as a direct assignee, so I recorded the claim with myself as tracker proxy before merging.

You wrote the claim as a scope statement and then shipped exactly that, including leaving the activation path alone. That loop has a separate defect in it — a failed deactivation can leave two prompts active for one task — and the issue kept it out because it needs a design decision first. Thank you for keeping this change focused and reviewable.

The test is the right shape too. One broken file and one healthy one, asserting both that the warning names the broken file and that the healthy prompt still comes back — that second assertion is what stops a future refactor from turning "skip and log" into "abort the request." Reverting your session.py change fails it; that is the difference between coverage and a regression test.

You also correctly omitted the suggested continue: the except is the last statement in the loop body, so it would have been redundant.

Fifty minutes from the issue being filed to a green PR. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(api): log prompt files omitted from GET /prompts

2 participants