Skip to content

Alert on a turn failure only when the turn itself failed - #374

Merged
n0rpan merged 1 commit into
mainfrom
host/failed-alert-terminal-only
Dec 3, 2026
Merged

n0rpan merged 1 commit into
mainfrom
host/failed-alert-terminal-only

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

A "Turn failed" alert should mean the turn the user is waiting on ended in a failure nobody is handling, such as running out of tokens. It also fired for things the agent recovers from by itself.

What changes

  • The turn's own outcome decides Failed or Finished. The host read the transcript's error banner, which an unrelated request (options, access, a history read) or an earlier turn can still hold. A turn that completed, or that the user stopped, while that banner was set raised "Turn failed". The host now reads the result recorded for the turn that just finished.
  • A subagent thread's failed turn raises no alert. The failure reaches the parent agent as a tool result and the parent carries on. The parent's own turn outcome is what the user hears about.
  • A worker that reports to a parent agent raises no alert for its own failed turn, for the same reason. The rule mirrors the existing gate in observe_worker_notices: a worker, not started by the operator, with a linked job or a parent session.

Unchanged: whether these threads raise Finished, the host-raised worker alerts in deliver_worker_notices (a job with no session, cancelled, interrupted), the push policy, and the wire protocol.

Verification

  • New tests: a completed and a stopped turn with a stale error raise Finished while a failed Codex turn raises Failed; a failed child thread raises nothing while its failed parent raises Failed (synthetic catalog child, and the stock Claude agent fixture); the worker predicate for a reporting worker, an operator-started worker, a detached worker and an unknown session.
  • cargo fmt --check, cargo clippy -p ox-desk-core -p ox-host --all-targets -- -D warnings, cargo test -p ox-desk-core (268 passed) and cargo test -p ox-host (170 passed) on Linux x86_64.
  • OpenCode and Antigravity were checked by reading: both record a result under the same turn id they report as finished. No test was added for them.
  • Not verified: an end-to-end alert on a desktop or a phone. The worker rule is tested on the registry predicate, not through a full process_scope run.

Checked against main at b918f44.

🤖 Generated with Claude Code

"Turn failed" came from the transcript's sticky error banner, so a turn that completed or was stopped while an unrelated request or an older turn left an error still raised a failure alert. Decide from the outcome recorded for the finished turn instead.

A child thread's failed turn is delivered to its parent agent as a tool result, and a worker that reports to a parent agent likewise hands its result to the agent. Neither raises a failure alert now; the parent's own turn outcome is what the operator hears about. Host-raised synthetic worker notices are unchanged, and whether such threads raise Finished is unchanged.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 8f4cec3

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T12:33:42.425260Z 8f4cec3 PR opened
🔒 Security Review ✅ Completed 2026-12-03T12:34:15.402500Z 8f4cec3 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.

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

In line to merge. Commit 8f4cec3 is reviewed with nothing blocking; it has entered the merge queue.

@n0rpan
n0rpan added this pull request to the merge queue Dec 3, 2026
n0rpan added a commit that referenced this pull request Dec 3, 2026
…-actions

# Conflicts:
#	desktop/ox-desk-core/src/store/projection.rs
Merged via the queue into main with commit 7b91493 Dec 3, 2026
28 checks passed
@n0rpan
n0rpan deleted the host/failed-alert-terminal-only branch December 3, 2026 15:04
n0rpan added a commit that referenced this pull request Dec 3, 2026
Main now carries the terminal-only failed alert (#374). Keep this
branch's version of the finished and failed alert, which adds the
detail line to the same decision.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
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