Repository navigation
Commit 1a5ce45
fix(mcp): expose reversible external thread settlement (#1649)
## Problem
The external MCP connection can read and filter settlement state but cannot change it.
Agents cannot perform the existing UI's settle/unsettle operation through that connection.
## Change
Add `t3_external_thread_settle` with required `threadId`, `settled`, and `clientRequestId`, delegating to the existing lifecycle commands.
Recheck coordination and project access before replay, enforce existing mode ceilings at preflight and under the thread lock, and return the original committed acknowledgement with its command ID and sequence.
Thread read/list continues to report current state after later owner changes.
Settlement retains existing side effects: cancel message-capable async questions and queued automatic wakeups, clear pins/PR watches, and detach provider sessions.
Unsettle reverses the settled flag without restoring those side effects.
The existing predicate rejects active root runs and blocking callback approvals/input; it does not inspect native/background children.
The marked contract export sits in the existing fork-only export group, avoiding the upstream append-boundary conflict.
Rebased onto accepted #1648; only manual resolution was two documentation tables, retaining both features' entries.
Accepted background read/wait behavior survives, including its limitation: resumed native child projections can remain stale.
## Scope and approval
User authorized this focused API parity fix, independent High review, publication, integration resolution and normal source closeout.
No UI, background-observability behavior, credential, grant, account, security-setting or mass-settlement changes.
Runtime release and acceptance remain separately owned.
## Verification
Head: `f1bc18d0fc2c12f37f118dd38b3ea6bb61c5f94b`.
Base/parent: `624767b5026c471d8f8a3ff03a4fddd83e8948df`.
Original checkpoint `a219060e89d4375858cea3c404aa4e7d6e6c6470` retained under `refs/wt-backup/fix/external-mcp-settlement`.
Independent native Codex `gpt-6.1-sol`, `reasoningEffort=high` review: **approve, no material findings** at the new exact head/base.
| Check | Result |
| --- | --- |
| `vp run fork:ci` | Exit 0; 756 scripts tests; scan/check green |
| External MCP, grant, contracts, upstream-client compatibility tests | Exit 0; 114 tests, including 20 settlement tests |
| Existing runtime settlement tests | Exit 0; 6 passed, 61 filtered out |
| Server and contracts typechecks | Both exit 0 |
| `vp run --filter t3 build:bundle` | Exit 0 |
| `vp run knip:check` | Exit 0 |
| HTTP request/response evidence test | Exit 0; 1 passed, 19 filtered out |
| Whole upstream merge-tree policy | Exit 0; no head-only conflicts |
[Final integration evidence](https://github.com/user-attachments/files/33127139/t3-settle-integration-evidence.zip) contains protocol request/response output, exact commands, logs, attributed terminal wrapper receipts and independent review.
Attachment readback matched uploaded bytes.
Policy comparison used the stated base and fresh upstream `3dfe373fddb966101371805b0b102ae5af75b15b`.
All eight required remote checks passed at this head ([CI run](https://github.com/RSI-Software/t3code-hyprws/actions/runs/37525775093)).
Ready-triggered gates remain separate from source CI and independent review.
[Original checkpoint evidence](https://github.com/user-attachments/files/33126181/t3-settle-cifix-evidence.zip) and [published checkpoint review](#1649 (review)) remain available.
That GitHub review is `COMMENTED`, not a formal approval.
<details>
<summary>Coverage and remaining release checks</summary>
Tests cover repeats, concurrent duplicates, key conflicts, session isolation, rebuilt-service recovery, owner reversal before acknowledgement, authorization failures, mode ceilings, and start/archive/delete/mode races.
Parity tests cover cancellations, pin/watch clearing, provider-session projection removal, durable detach intent, and the existing native-child predicate limitation.
The isolated HTTP fixture uses the real route/service/orchestrator with memory SQLite and a mock authenticator.
It does not execute provider processes or a full disk/process restart; existing aggregate lint and bundle warnings remain.
Installed catalog exposure, live authority/refusal behavior, real session detachment and client readback await release.
Runtime remains untouched; deployed `.965` commit identity was not established.
Reproduce protocol evidence at this head:
```sh
T3_SETTLEMENT_EVIDENCE=1 vp test run apps/server/src/mcp/external/ExternalMcpSettlement.fork.test.ts -t "exposes reversible settlement"
```
</details>
Implemented through the Codex harness with `gpt-6.1-sol` at High reasoning.
Native T3 selected provider instance `codex`; validated posting-worker provenance names backend `cliproxy`, harness `[email protected]`.
The new independent reviewer confirms Codex/Sol/High; its backend and harness version remain unconfirmed.
ChatGPT authentication and billing source remain unconfirmed.
## Fork trailers
Squashes:
- 874de6b fix(mcp): expose reversible external thread settlement (#1649) (#1649)
- ebe4e09 fixup! fix(mcp): expose reversible external thread settlement (#1649) (#1649)
Fork-Domain: device-auth
Fork-Tier: core
Co-authored-by: donjor <[email protected]>1 parent 681bf67 commit 1a5ce45
12 files changed
Lines changed: 1011 additions & 29 deletions
File tree
- apps/server/src
- mcp
- external
- toolkits/external
- orchestration-v2
- docs/fork/internals
- packages/contracts/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
| |||
503 | 513 | | |
504 | 514 | | |
505 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
506 | 589 | | |
507 | 590 | | |
508 | 591 | | |
| |||
0 commit comments