Skip to content

fix(supervise): keep coordination MCP identity stable across bridge resume #774

Description

@drewstone

Problem

supervise() reuses a deterministic manager session ID across a resume, but driveHarnessFromBackend adds the process-local coordination MCP URL to the effective AgentProfile sent to cli-bridge.

Runtime 0.131.5 therefore changes the canonical profile digest when the resumed process binds a new coordination port. cli-bridge exact session binding correctly rejects the request before spending tokens.

Reproduction

Discovery run q36-classical-sharp-constant-flash-20260810a used Runtime 0.131.5, profile discovery-lead@9f09543dc2caed57.json, Pi, and pi/tangle-router/fireworks/deepseek-v4-flash.

The first manager attempt stored external session supervised-manager-e8b0c320a4853de504f009ab26d93a731f2b6ac2ab4992d33439f0046ff96f03 with effective profile digest sha256:18c618f823964c5b755c02e0dd84d05a8537212512d9d44d45752466b92c318e and coordination URL port 36827. A direct resume reused that external session and failed with HTTP 400: session ... is bound to a different AgentProfile/model; tool calls and new spend were zero.

Raw evidence: /tmp/cli-bridge-q36-flash-jail-20260810-fixed-d/traces/spans.jsonl lines 35 and 71, and /tmp/cli-bridge-q36-flash-jail-20260810-fixed-d/sessions.sqlite.

Code path

dist/supervise-msTRhTN7.js in 0.131.5 shows driveHarnessFromBackend adding coordinationMcpUrl to effectiveProfile, while externalExecutionId("supervised-manager", { runNamespace, ownerId }) remains stable. cli-bridge PR #141 intentionally compares the full binding exactly.

Required fix

Preserve stable resume identity without weakening exact profile or model binding. Either persist and reuse the coordination endpoint across a resumable manager session, or model the runtime coordination attachment separately from the authored and session-bound profile. Add a regression that starts, tears down, and resumes a bridge-backed supervisor with a changed ephemeral coordination port, then proves the resumed turn succeeds with the same authored profile and exact model.

The bridge must continue to reject a genuinely changed authored profile or model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions