fix(mcp): preserve invoking turn identity - #360
Conversation
Route delegated session creation and chat through the exact persisted Turn principal while keeping machine credentials scoped to the executor. Freeze that provenance for retries, recovery, and continuation delivery. Model: gpt-5
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
5aab8dc to
40b4a4d
Compare
Model: gpt-5
Use the execution runtime as the authoritative source for delegated Session identity, keeping persisted history only as a legacy fallback. Preserve source-turn operation binding while narrowing Session authorization to the effective request subject. Model: gpt-5
Remove history-based identity reconstruction and keep active execution runtime identity fail-closed. Flatten source-turn provenance, centralize retry identity matching in the operation store, and narrow session delegation/runtime state. Model: gpt-5
|
Non-blocking architectural/security note: the HTTP MCP host still uses one daemon-wide bearer token, while session/workspace/machine identity is supplied by unsigned headers. Since This remains acceptable if the intended threat model is that agent runtimes and subprocesses under the same OS user are trusted. If coding agents become untrusted in the future, this boundary needs a session-bound capability or signed context rather than relying on a shared bearer plus unsigned session header. This does not block #360 identity correctness. |
Model: gpt-5
|
Implementation LGTM after syncing origin/main at 2407786. The active execution runtime is authoritative for invocation identity; persisted history is not used for identity reconstruction. New CI is green on the updated base/head. The HTTP MCP shared-bearer and unsigned-context-header concern remains non-blocking under the documented same-OS-user trusted-runtime assumption. |
Summary
Validation
pnpm --filter lody typecheckpnpm --filter lody exec vitest run src/mcp/lody-mcp-server.test.ts src/mcp/lody-mcp-server-chat-sync.test.ts src/orchestration/operation-store.test.ts src/orchestration/operation-coordinator.test.tspnpm --filter lody exec vitest run src/commands/session.test.ts -t "delegated requester identity"pnpm check:public-boundaryFull
session.test.tswas also attempted. Three existing Git fixture tests fail before assertions because this machine enables global GPG signing without the corresponding private key; all identity-related tests pass.The HTTP MCP host continues to use one daemon bearer token with unsigned session/workspace/machine context headers. This is currently acceptable under the existing trust model where agent runtimes and subprocesses under the same OS user are trusted. The active session header now participates in requester/principal selection, so an untrusted coding agent would require a session-bound capability or signed context in a future hardening change.