Skip to content

fix: accept goose-shaped AGENT_SESSION_ID without the AGENT marker - #377

Merged
laulpogan merged 1 commit into
mainfrom
fix/goose-session-shape
Aug 31, 2026
Merged

fix: accept goose-shaped AGENT_SESSION_ID without the AGENT marker#377
laulpogan merged 1 commit into
mainfrom
fix/goose-session-shape

Conversation

@laulpogan

Copy link
Copy Markdown
Collaborator

Problem

Follow-up to the goose adapter that landed in #374 (strict gate: AGENT=goose && AGENT_SESSION_ID). Live-probed goose 1.45.0: the harness forwards AGENT_SESSION_ID (its sessions.db id, YYYYMMDD_N-shaped) to MCP children and bash tools, but sets the AGENT=goose marker only via goose term init shell integration — MCP children never see it. With both required, every wire MCP under goose fell to the per-process minted path: a persona orphaned on every session restart, and unbounded by-key home accumulation (8,930 homes on one operator box, most minted lint).

Fix

is_goose_session_id (^\d{8}_\d+$ shape check) completes the gate:

  • AGENT=goose marker present → harness id honored as-is (any shape)
  • no marker, goose-shaped id → keys the session (the MCP-child reality)
  • no marker, foreign-shaped id → rejected; a foreign host cannot launder a goose persona

WIRE_SESSION_ID operator override still wins (covered by test (c)).

Verification

  • Live end-to-end on goose 1.45.0: goose run resolves the wire MCP to session_source=goose; goose run --resume keeps the same persona; two parallel sessions get distinct personas
  • New dual-gate matrix test; strict-gate test's foreign-marker case updated to the refined contract (foreign marker no longer blocks a goose-shaped id — that was the bug)
  • Full suite: 701 + 74 + 4 + 5 + 2 tests pass; fmt + clippy clean

Also in this branch

Carries f6fc2af (clippy 1.98 relay-handler/test-literal fixes) — committed on the shared worktree between my edits; included because its message says the 1.98 lints hard-fail CI for every PR.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 16 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 07eed9bf-48b7-4dd6-9b37-f1794d5829a8

📥 Commits

Reviewing files that changed from the base of the PR and between 3631337 and 407c585.

📒 Files selected for processing (1)
  • src/session.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploying wireup-landing with  Cloudflare Pages  Cloudflare Pages

Latest commit: 407c585
Status: ✅  Deploy successful!
Preview URL: https://ba6d0e9d.wireup-landing.pages.dev
Branch Preview URL: https://fix-goose-session-shape.wireup-landing.pages.dev

View logs

Live probe of goose 1.45: the harness forwards AGENT_SESSION_ID (its
sessions.db id, YYYYMMDD_N) to MCP children and bash tools, but the
AGENT=goose marker only reaches shells via goose term init. Gating the
goose adapter on both left every wire MCP under goose on the per-process
minted path — a persona orphaned on every session restart and unbounded
by-key home accumulation (8.9k homes on one operator box).

is_goose_session_id adds the shape check: AGENT=goose honors the id
as-is; otherwise a goose-shaped id keys the session; anything else
without the marker is rejected so a foreign host cannot launder a goose
persona. Live-verified end to end: goose run resolves the wire MCP to
source=goose, resume keeps the persona, parallel sessions get distinct
personas. Updates the strict-gate test's foreign-marker case to the
refined contract and adds the dual-gate matrix test.

Rebased on the post-#376 session.rs union (PI + Codex + goose strict).
@laulpogan
laulpogan force-pushed the fix/goose-session-shape branch from bf834eb to 407c585 Compare August 31, 2026 18:02
@laulpogan
laulpogan merged commit 4f2f8f6 into main Aug 31, 2026
10 checks passed
@laulpogan
laulpogan deleted the fix/goose-session-shape branch August 31, 2026 18:11
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