Skip to content

Fix claude preflight commands preventing task status updates.#13110

Open
vorporeal wants to merge 2 commits into
masterfrom
david/fix-claude-preflight-breaking-status-updates
Open

Fix claude preflight commands preventing task status updates.#13110
vorporeal wants to merge 2 commits into
masterfrom
david/fix-claude-preflight-breaking-status-updates

Conversation

@vorporeal

@vorporeal vorporeal commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Claude Code cloud agents register their terminal-view-to-task mapping before running the claude auth status --json preflight command. If that command is detected as a pane-scoped CLI agent session, its Ended event removes the mapping before the actual Claude harness starts. The real harness can then report Success and update the pane icon, but the task sync model no longer knows which server task to update.

Keep the task mapping for the process-scoped AgentDriver run instead of tying it to individual pane-scoped CLI agent sessions. This allows preflight commands and follow-up sessions to end without preventing later status updates. A regression test covers an incidental Ended event followed by Success and verifies that Succeeded is still uploaded.

Linked Issue

N/A

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • rustfmt --check on the changed Rust files
  • git diff --check
  • cargo nextest run -p warp -E 'test(cli_task_mapping_survives_cli_session_end)'
  • cargo check -p warp
  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

N/A — task lifecycle synchronization change with no UI changes.

Agent Mode

CHANGELOG-BUG-FIX: Fixed Claude Code cloud agents not reporting successful completion.

@cla-bot cla-bot Bot added the cla-signed label Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vorporeal vorporeal requested a review from liliwilson June 26, 2026 22:15
@vorporeal vorporeal marked this pull request as ready for review June 26, 2026 22:15
@oz-for-oss

oz-for-oss Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@vorporeal

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR changes LocalAgentTaskSyncModel so pane-scoped CLI session Ended events no longer remove the Claude/Oz task mapping, and adds a regression test for an incidental Ended followed by Success.

Concerns

  • The mapping is now kept past CLI session end, but the diff does not add an explicit cleanup path for when the process-scoped AgentDriver run actually finishes. That can leave stale terminal-view mappings that later pane-scoped CLI events can apply to an old task.
  • This is user-visible task status behavior, and the PR does not include manual validation or screenshots/recording showing the Claude Code cloud agent status update working end to end. For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

// harness, and follow-ups, but the mapping belongs to the driver run.
CLIAgentSessionsModelEvent::Started { .. }
| CLIAgentSessionsModelEvent::InputSessionChanged { .. }
| CLIAgentSessionsModelEvent::Ended { .. }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] Ignoring Ended fixes preflight sessions, but this PR never removes the run-scoped mapping when the AgentDriver actually finishes. A later manual or follow-up CLI session in the same terminal view can still emit StatusChanged and update the old task; add an explicit unregister/cleanup path tied to the driver run before leaving Ended ignored.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this actually isn't necessary, since we tear down the app when the AgentDriver finishes, but in the name of being slightly more robust to future changes, and to prevent any other agents from similarly misunderstanding this, i've made the requested changes.

@vorporeal

Copy link
Copy Markdown
Contributor Author

/oz-review

@oz-for-oss

oz-for-oss Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@vorporeal

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR moves Claude/third-party CLI task-status mapping ownership from individual pane-scoped CLI sessions to the process-scoped AgentDriver run. It keeps mappings alive across preflight/session Ended events, explicitly unregisters at driver completion, and adds a regression test covering an incidental Ended followed by Success.

Concerns

  • No blocking correctness or security concerns found in the changed lines.
  • No approved repository spec context was provided, so there was no spec drift to evaluate.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant