Skip to content

fix(cli): send facets read failures through the shared terminal - #5731

Merged
Sinity merged 5 commits into
masterfrom
fix/facets-read-failure-terminal
Sep 29, 2026
Merged

Sinity merged 5 commits into
masterfrom
fix/facets-read-failure-terminal

Conversation

@Sinity

@Sinity Sinity commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

polylogue facets now sends every typed operation-kernel failure through exit_for_read_failure, the path every other read route already uses.

Problem

_fetch_daemon_facets caught only OperationUnavailableError. Any other OperationKernelError escaped the Click command as a raw exception: a dropped daemon connection (daemon_transport_error), a deadline, a cancellation, or an invalid request. The operator got no exit status for the failure class, no call id and no remedy. This residual came from the salvage ref work/luna-x1. Its other hunks are already on master.

Solution

The existing OperationUnavailableError → DaemonRequiredError conversion stays. A second except OperationKernelError hands every other typed failure to exit_for_read_failure.

Verification

  • devtools test tests/unit/cli/test_read_failure_exit_codes.py tests/unit/cli/test_machine_main.py result: 33 passed, PASSED exit=0.
  • The new test test_the_facets_route_leaves_through_the_read_failure_terminal drives the real facets CLI route for the transport, deadline, cancelled and invalid-request cases. It fails if the new branch is removed.
  • Master's quick gate was red on two stale baselines, and this PR fixes them forward in a second commit. First, the layering sqlite-degradation baseline is re-anchored to two handlers from fix: realign stale master tests and keep unreadable SQLite retryable #5729: the one it moved in production_baseline.py and the retryable read-fault handler it added in live/batch.py. Both are deliberately classified by retryable_read_fault. Second, the query_verbs.py anchor that fix: Codex P2 review debt: polylogue/cli part 1 (25 findings) #5722 made stale is pruned from cli-nonzero-click-exit.
  • devtools verify --quick result: PASSED exit=0, with all 12 gates ok.

Residuals

None known.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

`facets` converted only OperationUnavailableError. A dropped daemon
connection, a deadline or a cancellation escaped the command as a raw
exception, where every other read route leaves through
exit_for_read_failure with its exit status, call id and remedy.

Recovered from the salvage ref work/luna-x1; its other hunks are
already on master.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity
Sinity enabled auto-merge (squash) September 28, 2026 18:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T21:16:58.114822Z ffcff7b Manual request
🔒 Security Review ✅ Completed 2026-09-28T18:48:37.720889Z a3c3141 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

#5729 moved one sqlite handler in production_baseline.py and added the
retryable read-fault handler in live/batch.py. Both are classified by
retryable_read_fault on purpose, so the layering baseline is re-anchored
to them. #5722 removed the query_verbs.py site the cli-nonzero-click-exit
pattern baseline still named, so that stale anchor is pruned.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity

Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73f66164d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread polylogue/cli/commands/facets.py Resolved
The shared read-failure remedies for a deadline or an oversized result
name --limit/--since/--offset, which facets does not take. The terminal
now accepts command-specific remedies, and facets points at --query,
--origin and --include-deferred instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity

Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: ffcff7b17d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Resolve conflicts in devtools/patterns/baselines/cli-nonzero-click-exit.txt
and docs/plans/sqlite-degradation-baseline.json: both are generated
content-anchored baselines master rewrote to the file:digest:context
format in the same window this PR pruned/re-anchored entries in. Take
master's rewritten baseline verbatim for the cli-nonzero-click-exit
pattern (this PR's own removal of the query_verbs.py anchor was already
independently reflected there); keep this PR's own new batch.py anchor
in the sqlite-degradation baseline (added deliberately in #5729/this
branch's prior commit for the classifier-scope change to
retryable_read_fault) and drop the stale duplicate production_baseline.py
entry master already relocated.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

The merge with origin/master carried the merge branch's own added anchor
for polylogue/sources/live/batch.py (digest 5b632e9d..., added earlier
in this PR's own #5729/re-anchor commit) forward unchanged, but master's
independent edits to batch.py in the same window changed that handler's
normalized text so the anchor no longer reproduces. `devtools gate
layering` on the merged head reports it stale
(sqlite_degradation_shrunk); pruned per its own suggested fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Sinity
Sinity merged commit 7bea43e into master Sep 29, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the fix/facets-read-failure-terminal branch September 29, 2026 09:18
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.

1 participant