GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): carry run identity to prevent late output submissions crossing runs (closes #39005) by PranavTJ-05 · Pull Request #39022 · pingdotgg/t3code

Conversation

@PranavTJ-05

@PranavTJ-05 PranavTJ-05 commented Nov 19, 2026

Copy link
Copy Markdown

Resolves #39005

Background

When a run asked for a typed result is stopped while an agent's t3_submit_output call is in flight and a successor run starts on the same thread with a compatible schema, submitRunOutput historically bound the submission to latestActiveRun(records). Because the MCP caller identity did not carry the run, the in-flight submission from the stopped run would land on the successor run.

Changes

  1. MCP Session & Caller Identity:
    • Added runId?: RunId | undefined to McpThreadCaller (McpInvocationContext.ts) and McpProviderSessionConfig (mcpSession.ts).
    • Extended McpCredentialRequest and McpSessionRegistry.issue to track runId on the issued credentials and session scope.
  2. Turn Start Lifecycle:
    • In ProviderSessionManager.ts, passed runId from startTurn into ensureThreadAttached and prepareMcpSession. If an existing credential belonged to a different runId, a fresh credential for the turn's run is issued.
  3. Validation on Output Submission:
    • Forwarded scope.thread.runId in t3_submit_output (handlers.ts).
    • In ThreadManagementService.submitRunOutput, verified if (input.runId !== undefined && run.id !== input.runId) and rejected stale submissions with ThreadManagementRunOutputRejectedError("This output was submitted for a turn that is no longer active.").
  4. Tests:
    • Added unit test in McpSessionRegistry.test.ts verifying runId propagation to session config and thread caller scope.
    • Added integration test in ThreadLaunchService.test.ts verifying that late output submissions specifying an inactive/stale runId are rejected and do not mutate the active run, while valid runId submissions succeed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
juliusmarminge and others added 6 commits November 18, 2026 23:55
@juliusmarminge @claude
feat(server): a thread turn can return a typed result
b59cecc
A message can carry an outputSchema (JSON Schema). The run stores it, the
turn's prompt ends with how to hand the result back, and the agent calls
t3_submit_output. The server checks the value against the schema before
storing it on the run, and t3_thread_wait returns it as output. The CLI
takes --output-schema on start and send.

A send that asks for a result is queued, never steered.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@juliusmarminge @claude
fix(server): a typed result is checked more strictly and kept across …
ae718c7
…more ways a turn starts

A closed schema turns down keys it does not name. A run that has ended takes no
result. A run started through a provider handoff keeps its schema. A command a
provider runs itself cannot be asked for a result. The CLI keeps the result when
it follows a run that background work woke. What a submission got wrong is kept
as the error's cause, not in its attributes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@juliusmarminge @claude
fix(server): a run that was asked to stop takes no result
5611fe2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
fix(server): a provider command sent straight to dispatch cannot ask …
68b531b
…for a result

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
fix(server): a submitted result outlasts older copies, and a queued r…
8ed680e
…equest for one stays a prompt

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
test(server): the agent context budget is measured again on top of main
de08c94
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PranavTJ-05 PranavTJ-05 mentioned this pull request Nov 19, 2026
Typed results: a late submission can land on the next run of the thread #39005
Open
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Nov 19, 2026
@PranavTJ-05
fix(server): carry run identity to prevent late output submissions cr…
0839af4
…ossing runs

When an agent's t3_submit_output tool call is in flight while a run is stopped and a successor run starts on the thread, submitRunOutput previously resolved the run via latestActiveRun without verifying the caller's run identity.

Carry runId through MCP session credential issuance and invocation context, forward it in t3_submit_output, and validate that the submission targets the currently active run, rejecting submissions intended for a previous turn.

Closes pingdotgg#39005
@PranavTJ-05
PranavTJ-05 force-pushed the fix/typed-results-late-submission branch from 5f06d91 to 0839af4 Compare November 19, 2026 08:12
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Nov 19, 2026
@PranavTJ-05

PranavTJ-05 commented Nov 19, 2026

Copy link
Copy Markdown
Author

Note: The Agent Context Budget check is flagging the +580 byte increase in agentContextBudget.json against main because this PR branches off feat/thread-typed-result (which added t3_submit_output). This PR itself introduces 0 new bytes to the budget. Could a maintainer please apply the agent-context-increase label (as was done on #38874)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge force-pushed the feat/thread-typed-result branch from de08c94 to a55f88b Compare November 20, 2026 23:35
@juliusmarminge
juliusmarminge deleted the branch pingdotgg:feat/thread-typed-result November 20, 2026 23:44
@juliusmarminge juliusmarminge closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@PranavTJ-05 @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.