Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Link cards now stop asking after a newer user-role message, including agent-authored messages, keeping thread status and settlement eligibility consistent. Existing active-run and settlement safeguards remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Moved to #32473, the same commit from a personal fork. This PR came from the organization-owned |
Problem
When an agent calls
t3_environment_link, its link card marks the thread as waiting for input. #28491 made the card stop counting once the user writes in the thread again, but it counts only messages withcreatedBy: "user". Threads that agents drive, through subagent notifications, coordination messages from other threads, or a thread started over MCP, may never get one. They stay on Input for good while every pending-request list is empty.To reproduce, have an agent ask for a link and end its turn. Then start another turn with an agent-authored message, for example
t3 thread send. The thread finishes but still shows Input, andt3 thread showreportspendingRequestCount: 0. In the thread where this surfaced, a card asked 53 runs earlier kept the thread on Input. A watcher keyed on that status also re-reported "asks a question" on every new run.Change
The card now stops counting once any user-role message newer than it arrives, whoever sent it. Idle compactions still don't count. Both shell paths (
threadShellFromProjectionand the SQL shell row) and the auto-settle query from #29847 use the same rule. A thread that reads as done can therefore also settle. The card stays pending and answerable in the timeline. Secret cards are unchanged.Scope and approval
This is a very small, focused fix for an obvious bug. It finishes the rule #28491 introduced for threads that no person types into, and it changes one comparison in three places that must agree. It is server-only. Web, desktop, and mobile read
pendingRuntimeRequestfrom the shell, so they pick it up with no client changes. #26944 is related but separate. It ends a card after a matching retry links, and in this case no retry happened.Verification
the agent asks without waiting…case inPeerLinkRequests.test.tsnow writes an agent-authored message past the card. Onmainit fails withexpected { …(4) } to be nullat the shell assertion. With the fix, it passes, and the settlement assertion after it passes too.PeerLinkRequests.test.ts,ProjectionSettlement.test.ts, andThreadSettlementService.test.tspass 58/58.PeerLinkRequestsservice against a served peer.Model and harness: Claude Opus 5.5 (lead, implementation) via Claude Code in T3 Code.