Skip to content

fix: stop showing finished T3 Code subagents as waiting - #21

Merged
jameswyse merged 3 commits into
mainfrom
fix/t3-subagent-waiting
Oct 16, 2026
Merged

jameswyse merged 3 commits into
mainfrom
fix/t3-subagent-waiting

Conversation

@jameswyse

@jameswyse jameswyse commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Why the change

The dashboard showed T3 Code subagent threads as waiting for you long after they had finished and their parent threads were settled, and FleetFrog expected T3 Code's schema at migration 61 when T3 Code is now at 62.

Change outline

Finished subagents are no longer waiting

A Codex subagent can ask a question and then complete its run, leaving its user_input request pending with nobody to answer it. T3 Code only surfaces a subagent's pending request while the subagent's run is active. Both agents now read lineage.relationshipToParent from the thread payload and apply the same rule.

 thread payload (orchestration_v2_projection_threads.payload_json)
   worktreePath: string | null
+  lineage: { relationshipToParent: string | null }

 state
-  waiting = has a pending request other than auth_refresh
+  waiting = has a pending request other than auth_refresh
+            and (not a subagent or has an active run)
   working = has a run that is preparing, starting, running or waiting

Schema at migration 62

T3 Code's migration 62 (ThreadFailureLookupIndex) only adds a partial index on orchestration_v2_projection_turn_items, which neither agent reads.

 export const supportedT3CodeSchema: T3CodeSchema = {
-  migration: 61,
-  name: "PullRequestReviewGuides",
+  migration: 62,
+  name: "ThreadFailureLookupIndex",
 };

Notes

  • A V2 thread whose payload has no lineage now counts as an unread record. T3 Code's own thread schema requires lineage, and every thread on both machines checked has it.

Verification

  • pnpm verify passes.
  • The new readT3Code test cases fail without the fix: a finished subagent with a pending question reads as Waiting.
  • Both agents read a live T3 Code database at migration 62 identically through the agent parity check.
  • On a copy of a second machine's T3 Code tables, which had three finished subagents with pending questions, both agents report schema 62, no unread records, and those threads as Idle.

Note

Fix finished T3 Code subagents showing as waiting

  • Subagents are now detected from the lineage.relationshipToParent field in V2 thread payloads, replacing the old worktree-path-based layout flag in the Rust decoder and adding subagent detection in the TypeScript decoder
  • When a decoded subagent has no active work, the waiting value is forced to zero, so finished subagents no longer show as waiting; active subagents and non-subagent threads keep their database-derived state
  • V2 payload schemas now require worktreePath and lineage.relationshipToParent as nullable strings; payloads missing these fields are rejected
  • Bumps supported T3 Code schema to migration 62, ThreadFailureLookupIndex, in t3Code.ts
  • Behavioral Change: V2 thread rows written without the lineage field will now fail decoding in readT3Code.ts and mod.rs

Macroscope summarized c2356f0.

T3 Code's migration 62 (ThreadFailureLookupIndex) only adds a partial
index on orchestration_v2_projection_turn_items, which neither agent
reads. Both agents read live databases at migration 62 on EpicDev and
Studio identically with no unread records, so the supported schema
moves to 62.
A Codex subagent can ask a question and then finish its run, leaving a
user_input request pending that nobody will answer. T3 Code only surfaces
a subagent's pending request while the subagent's run is active, so it
showed the settled parent threads as done while FleetFrog showed the
subagents as waiting for you indefinitely.

Both agents now read the thread's lineage from its payload and count a
subagent as waiting only while it has an active run. A thread payload
without lineage is unreadable, as T3 Code's own schema requires it.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 07:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T07:18:30.928266Z d90948a PR opened
🔒 Security Review ✅ Completed 2026-10-16T07:19:17.359611Z d90948a 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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-t3-subagent-waiting.fleetfrog.dev, https://fix-t3-subagent-waiting-fleetfrog-website.jameswyse.workers.dev (commit c2356f0)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://56d20e69.fleetfrog.dev, https://56d20e69-fleetfrog-website.jameswyse.workers.dev c2356f0 2026-10-16T07:21:26.015Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://d3be7bb0.fleetfrog.dev, https://d3be7bb0-fleetfrog-website.jameswyse.workers.dev d90948a 2026-10-16T07:16:58.878Z Visit the dashboard ↗

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 16, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Approved at c2356f0

Macroscope's review found this PR approvable — This is a focused correction to existing T3 Code status decoding, with matching Rust and TypeScript behavior and targeted test coverage. Supporting schema metadata, changesets, and E2E data updates are bounded and introduce no new capability or sensitive runtime surface.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@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: d90948a197

ℹ️ 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 apps/agent-ts/src/t3Code/readT3Code.ts
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 16, 2026 07:20

Dismissing prior approval to re-evaluate c2356f0

@jameswyse
jameswyse merged commit b73536a into main Oct 16, 2026
11 checks passed
@jameswyse
jameswyse deleted the fix/t3-subagent-waiting branch October 16, 2026 07:24

Copilot AI 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.

🟡 Changes recommended

The shared E2E fixture lacks the newly required lineage field, causing its running thread to be discarded and integration assertions to fail.

1 open finding
What changed in this PR

Corrects T3 Code thread status reporting in both agents so finished subagents no longer appear as waiting.

Changes:

  • Suppress pending-request waiting status for subagents without an active run.
  • Add regression cases for finished and active subagents.
  • Update the supported schema to migration 62 and add release notes.
File Description
packages/​protocol/​src/​domain/​t3Code.ts Updates the supported schema to migration 62.
apps/​agent-ts/​src/​t3Code/​readT3Code.ts Reads lineage and adjusts subagent waiting status.
apps/​agent-ts/​src/​t3Code/​readT3Code.test.ts Covers finished and active subagent states.
apps/​agent-rs/​src/​t3code/​mod.rs Applies matching lineage and status handling.
.changeset/​frank-times-wave.md Documents the schema expectation update.
.changeset/​clear-rice-attack.md Documents the subagent status fix.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Schema.Struct({ worktreePath: Schema.NullOr(Schema.String) }),
Schema.Struct({
worktreePath: Schema.NullOr(Schema.String),
lineage: Schema.Struct({ relationshipToParent: Schema.NullOr(Schema.String) }),
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.

2 participants