Skip to content

fix(orchestration): persist linked pull requests - #8689

Merged
juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
agents/mcp-thread-metadata/persistence
Sep 6, 2026
Merged

fix(orchestration): persist linked pull requests#8689
juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
agents/mcp-thread-metadata/persistence

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

Problem

The V2 metadata command accepts linked pull requests, but the decider drops that field, so links never reach the persisted event or projection.

Change

Apply linkedPullRequest during metadata updates while preserving absent-field compatibility. Focused runtime coverage proves link, shell projection, projection rebuild, and unlink behavior.

Validation

  • vp test run apps/server/src/orchestration-v2/runtimeLayer.test.ts (14 tests)
  • Targeted lint for the two changed files
  • vp run --filter t3 typecheck

Dependency

Based directly on agents/mcp-controls/base-490318a at the agreed 490318a prerequisite snapshot. Native stack #8709: #8689#8690. The MCP metadata tool remains a separate dependent layer; no feature code changed when the rewritten live trunk was replaced as the review base.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

Note

Fix Orchestrator.layer makeOrchestrator to persist linkedPullRequest

The makeOrchestrator function now includes linkedPullRequest in the built object when the command supplies it, including null to represent unlinking. When command.linkedPullRequest is undefined, the field is omitted from the payload. Adds a lifecycle test covering link, projection rebuild, and unlink flows in runtimeLayer.test.ts.

Macroscope summarized 1d9e754.


Note

Low Risk
Small, targeted decider fix with regression tests; no auth or broad behavioral changes beyond persisting an already-defined metadata field.

Overview
Fixes a gap where thread.metadata.update accepted linkedPullRequest but the V2 orchestrator decider never applied it, so links never made it into thread state, events, or projections.

The thread.metadata.update handler in Orchestrator.ts now merges linkedPullRequest when the command sets it (including null to unlink), and omits the field when it is undefined, matching other optional metadata fields.

A runtime-layer test covers linking a PR, reading it from the thread projection and shell, surviving a projection rebuild, and unlinking via linkedPullRequest: null.

Reviewed by Cursor Bugbot for commit 1d9e754. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0a7ebcd-a299-41d6-92cb-b3648ad37245

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 1d9e754.

This comment will update automatically after the next completed run.

@juliusmarminge
juliusmarminge marked this pull request as ready for review August 29, 2026 22:33
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 29, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 7bc232e

Macroscope's review found this PR approvable — This is a narrowly scoped orchestration persistence fix: an existing linked pull request is now retained through event projection rebuilds, with explicit unlinking preserved. The production change is minimal and covered by an integration test for linking, rebuilding, and unlinking.

No code changes detected at 1d9e754. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-controls/base-490318a August 30, 2026 00:51
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 30, 2026 00:51

Dismissing prior approval to re-evaluate daa8739

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-metadata/persistence branch from daa8739 to ba621a1 Compare August 30, 2026 17:11
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 30, 2026 17:12

Dismissing prior approval to re-evaluate ba621a1

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Aug 30, 2026
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:12
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 30, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

@macroscopeapp
macroscopeapp Bot dismissed their stale review August 30, 2026 17:31

Dismissing prior approval to re-evaluate ba621a1

@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-metadata/persistence branch from ba621a1 to 7bc232e Compare August 30, 2026 20:15
@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-metadata/persistence branch from 7bc232e to 1d9e754 Compare September 5, 2026 05:54
@juliusmarminge
juliusmarminge merged commit 792e281 into t3code/codex-turn-mapping Sep 6, 2026
26 checks passed
@juliusmarminge
juliusmarminge deleted the agents/mcp-thread-metadata/persistence branch September 6, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant