Skip to content

refactor(mcp): simplify cross-environment thread reads - #351

Merged
lastobelus merged 3 commits into
lastcode/mainfrom
lastcode/thread-read-cleanup
Oct 9, 2026
Merged

lastobelus merged 3 commits into
lastcode/mainfrom
lastcode/thread-read-cleanup

Conversation

@lastobelus

@lastobelus lastobelus commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Cross-environment thread reads repeated input authorization in client dispatch, thread creation, send, and launch. Each read also loaded its caller twice. This cleanup consolidates that logic in ThreadReadBroker, reuses the loaded caller, and simplifies the first-success destination search.

Reads and inherited authorization retain the caller's captured run, so a later input cannot lend another client's access. The existing raw-ID lookup, pagination, delegated reads, scoped links, and destination permissions are preserved. Shared test fixtures retain the regression cases and now cover source advancement during reads, sends, and launches. The cleanup removes 69 implementation lines and 76 test lines overall across ten files.

Validation:

  • 205 focused server tests and 8 client-runtime tests passed after rebasing onto main.
  • The three suites affected by the captured-run correction passed all 22 tests.
  • The server package typecheck and all four activity regressions passed after correcting a snapshot fixture type mismatch caught by CI.
  • Focused lint, formatting, and server/client-runtime typechecks passed during implementation. Astra High's follow-up review was clean after correcting its run-authority finding.
  • After refreshing onto current main, all 22 server regressions and 8 client-runtime tests passed again. Local Quick CI deferred because capacity was busy; the required GitHub checks validate the refreshed commit. No presentation components or wire contracts changed.

Follow-up to #347.

Implementation: Claude Opus 5.5 through Claude Code. Review: GPT-6-Astra High through Codex. CI repair, validation, and delivery: GPT-6.1-Sol through Codex.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T08:10:24.268185Z 9be983a Manual request
ℹ️ 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.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 9fadc56da2

ℹ️ 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".

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c8f485d1f9

ℹ️ 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".

Consolidate input authorization and inherited run access in the thread-read broker. Reuse caller state for local reads, simplify concurrent destination lookup, and share regression fixtures.

Model: Claude Opus 5.5. Harness: Claude Code.

Carry-Group: incubator
Carry-Fix: #347
Carry-Observation: Cross-environment thread-read routing and its authorization tests form one feature; this cleanup keeps their ownership together.
Pass the caller run into broker reads and inherited input authorization so a later input cannot lend its client access. Extend deterministic coverage for source advancement during reads, sends, and launches.

Model: Claude Opus 5.5. Harness: Claude Code. Validation: GPT-6.1-Sol through Codex.

Carry-Group: incubator
Carry-Fix: #347
Carry-Observation: Preserve the original initiating-run access boundary while consolidating cross-environment read authority.
Materialize the existing projection getter without overriding its runs with an unknown array. Preserve the source-advance regression while satisfying the projection service contract.

Model: GPT-6.1-Sol. Harness: Codex.

Carry-Group: incubator
Carry-Fix: #351
Carry-Observation: Keep the captured-run regression fixture type-safe without changing runtime thread-read behavior.
@lastobelus
lastobelus force-pushed the lastcode/thread-read-cleanup branch from c8f485d to 9be983a Compare October 9, 2026 08:06
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 9be983a05c

ℹ️ 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".

@lastobelus
lastobelus merged commit 6c2dbae into lastcode/main Oct 9, 2026
17 checks passed
@lastobelus
lastobelus deleted the lastcode/thread-read-cleanup branch October 9, 2026 08:17
lastobelus added a commit that referenced this pull request Nov 16, 2026
…ion (#741)

Upstream already tests peer-link snooze clearing, card completion and outcome notification (added in https://redirect.github.com/pingdotgg/t3code/pull/20058, fixture later refactored in https://redirect.github.com/pingdotgg/t3code/pull/26944). LastCode also carried a diagnostic-only addition to that test, `491ad0c4ba27fd683cd2ed2eec040b7a274651d6` ("test: show the peer-link outcome when wake fails"). Carrying it means replaying an edit to an upstream test on every checkpoint, which adds churn without adding coverage.

This PR removes the `JSON.stringify(cardOf(a))` diagnostic argument from the `snoozedUntil` `toBeNull` assertion in `apps/server/src/peer/PeerLinkRequests.test.ts` (one file, 5 lines). No test case or behavioral assertion is removed, and there is no runtime change.

The fixture and API adaptations from `7be36ba46e0733f9144d3a040a017d4b6a435cc5` stay. They are now the only LastCode delta in this test:

- `ActionResume` and `ThreadReadBroker` provisioning. See #347 and #351 for the `ThreadReadBroker` dependency, and #509 for the Action metadata read dependency.
- The archive child disposition fields.

This should reduce replay churn on this test. It does not claim to remove all future drift. An archived run shows one replay conflict here, but the original Full CI failure log is unavailable, so this PR doesn't claim to identify or fix that failure's cause.

Validation:

- All 25 peer-link tests pass.
- The changed-file check passes: 27 tests, affected typechecks, format, lint, GraphQL and knip.
- Saved Quick CI passed on head `b95125df9c8ee12f2a8614aa05c54d327fdbebea` against base `006e9d3b50a50df3d21ed3061e9185b186845b1b`.

Local review: 2 rounds with gpt-6.1-terra (xhigh), approved.

Carry-Group: incubator
Carry-Supersedes: 491ad0c4ba27fd683cd2ed2eec040b7a274651d6

GPT-6.1 Sol through Codex. Local review: GPT-6.1 Terra xhigh. PR wording: Claude Sonnet 5.5.

Carry-Source-Ref: refs/lastcode/carry-sources/pr-741/b95125df9c8ee12f2a8614aa05c54d327fdbebea
Carry-Source-Base: 006e9d3
Carry-Source-Head: b95125d
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