Skip to content

feat(mcp): settle the caller thread after successful completion [L23] - #109

Merged
Mjones13 merged 3 commits into
work/jones-rebuild/stagingfrom
work/jones-rebuild/L23-self-settlement
Oct 5, 2026
Merged

Mjones13 merged 3 commits into
work/jones-rebuild/stagingfrom
work/jones-rebuild/L23-self-settlement

Conversation

@Mjones13

@Mjones13 Mjones13 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Agents can request settlement of their own thread through t3_thread_settle({clientRequestId}) while finishing a reply. The request leaves that run active and settles the thread only after its durable successful completion, using the existing settlement and provider-detach flow.

The request requires the exact attached provider session, instance, thread, issued MCP credential, and active attempt. A repeated request key returns its original run receipt. New user work, conflicting lifecycle actions, unsuccessful completion, or startup recovery cancels the intent; automatic completion wakeups preserve the existing behavior. Optional persisted metadata remains compatible with historical projections. No schema migration or additional runtime service is introduced.

This rebuild ports owner #85 onto the pinned nightly V2 implementation. It targets work/jones-rebuild/staging after a normal integration of the qualified capacity/account-switch parent. Original #85 remains a reference-only, unmerged branch.

Validation of the combined candidate:

  • 484 tests passed across 20 affected and parent-interaction modules, with no skips. The initial combined invocation contained a wrong selection-restart path; its verified module was then run separately and passed all 13 tests, completing the deduplicated union.
  • Server and contracts typechecks pass. A deterministic parent-tool substitution fails the new discovery assertion as expected; the candidate was restored.
  • Scoped formatting/lint and commit hooks pass. Three new fixture schema-compilation advisory warnings and one existing unused declaration warning remain.
  • Full dependency analysis and the production server bundle build pass.

Tests exercise synthetic/in-memory/SQLite state, durable effects, replay, rejection, and lifecycle cancellation. They do not qualify live provider shutdown, actual checkpoint capture, restart execution, or installed-runtime adoption. No deployment occurred.

Contributing thread: 40439454-5570-42fd-85f6-b370799bc9e4. Source-only builder handoff and coordinator fixture repairs are recorded in the rebuild task evidence. Root owns Git, validation, and publication.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Hosted CI repair: register t3_thread_settle in the shared tool presentation inventory and add a request-specific client summary. An accepted receipt is described as requested settlement, never completed settlement. The original failing core test remains unchanged. Repair validation: 191 tests across seven modules, shared/client/server typechecks, scoped formatting/lint and commit hooks. New-head hosted CI remains pending.

@Mjones13
Mjones13 merged commit 0ad04f1 into work/jones-rebuild/staging Oct 5, 2026
18 checks passed
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.

1 participant