Skip to content

Structured worker result in the lead's wake notice, rendered as a card (#1427) - #1606

Merged
currentbits merged 1 commit into
mainfrom
coder/p2-structured-worker-result-in-the-lead--7e14e2
Oct 12, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/p2-structured-worker-result-in-the-lead--7e14e2

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #1427.

What

Step 1: notice block (electron/runner-orch-notices.js). queueOrchNotice now appends a [worker result <id>] … [/worker result] block, capped at 2,000 chars. It is built only from data Solenta already stores:

  • git diff --stat --summary <leadSnapshotSha>..<branch>. mode 120000 lines go first so the cap can't hide a symlink swap (the core/dist case).
  • The verify verdict, only while a verifyCommand is set, so a stale verdict is never reported.
  • The worker's invalidated hypotheses.
  • Its review-itinerary risks.

The git call is synchronous with a 5s timeout and diffs commit to commit. Doing it async would let a notice land after the user stopped the lead (#32) and could reorder notices.

Step 2: card (src/workerResult.ts, src/components/thread/messages.tsx). Notices with a block render as a card as soon as they arrive. The "Integrate into lead" button calls git:integrateWorker directly, the same path as the Agents panel button, so it is a human action that never goes through the lead's auto-turn gate. Other lines in the same notice stay visible above the card. The full text is in a collapsed "Full notice".

Tests

  • electron/test/worker-result-block.test.js uses a real git repo: the create mode 120000 line, truncation at the cap, and itinerary risks.
  • test/threadView.test.tsx: the card renders and its button calls integrateWorker. It also parses the runner's real workerResultBlock output, which tests the seam between the two sides.
  • tsc and vite build are clean. The electron suite has 2 failures (automation-create-mcp trigger fields, store prLinks). Both also fail on clean main and are unrelated to this change.

Note

The button integrates directly instead of opening the Integration tab. The issue's test wording ("its button calls integrateWorker") asked for that.

🤖 Generated with Claude Code

#1427)

queueOrchNotice appends a capped [worker result] block: diffstat+summary
vs leadSnapshotSha (symlink lines first), verify verdict, ruled-out
hypotheses, and review-itinerary risks. The lead's transcript renders
it as a card whose button calls git:integrateWorker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-10-12T13:19:07.212794Z 8ff5207 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.

@currentbits
currentbits merged commit 3b650a5 into main Oct 12, 2026
4 of 6 checks passed

@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: 8ff52074fe

ℹ️ 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 on lines +49 to +52
const res = gitTry(
thread.worktreePath,
["diff", "--stat=100", "--stat-count=40", "--summary", `${base}..${tip}`],
{ raw: true, timeout: 5000 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wait for the worker checkpoint before diffing commits

For the common worker without a verify command, afterSuccessfulTurn starts maybeCreateCheckpoint without awaiting it and immediately calls finishSuccessfulTurn (electron/runner-verify-gate.js:127-133). This commit-to-commit diff therefore runs while the worker's just-finished changes are still uncommitted—indeed, the synchronous gitTry prevents the asynchronous checkpoint from completing first—so the permanent result card can report Changes ...: none or omit files such as a symlink replacement. Await the checkpoint before queuing the notice, or include the working tree in the summary.

Useful? React with 👍 / 👎.

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.

P2: Structured worker result in the lead's wake notice, rendered as a card

1 participant