Skip to content

profileOptimizerModelCall rejects valid CLI Bridge wire model after successful execution #777

Description

@drewstone

Summary

profileOptimizerModelCall rejects a successful CLI Bridge turn when the portable AgentProfile model omits the harness prefix, as required by the current profile contract.

The bridge reports the materialized wire model pi/tangle-router/glm-5.2.
The adapter compares it to AgentProfile.model.default (tangle-router/glm-5.2) and returns failure after the paid turn completes.

Versions

  • @tangle-network/agent-runtime@0.131.5
  • @tangle-network/agent-interface@0.46.1
  • Pi 0.84.1 through CLI Bridge

Reproduction

const profile = {
  name: 'optimizer smoke',
  harness: 'pi',
  model: {
    default: 'tangle-router/glm-5.2',
    provider: 'tangle-router',
    reasoningEffort: 'none',
    metadata: { maxTokens: 32 },
  },
}

const call = profileOptimizerModelCall({
  profile,
  executor: {
    backend: 'bridge',
    bridgeUrl: 'http://127.0.0.1:29999',
    bridgeBearer: 'local-test-token',
  },
  context: 'optimizer smoke',
})

const result = await call({
  callId: 'optimizer-smoke-1',
  request: {
    model: 'tangle-router/glm-5.2',
    messages: [{ role: 'user', content: 'Reply with exactly READY.' }],
    maxTokens: 32,
  },
})

Observed

The harness turn completes and reports 2,749 input tokens and 17 output tokens.
The callback then returns:

Runtime reported model "pi/tangle-router/glm-5.2" but AgentProfile requires "tangle-router/glm-5.2"

The execution evidence reports status: "completed", model: "pi/tangle-router/glm-5.2", and event types backend_start, llm_call, artifact, final, but the callback reports succeeded: false.

Putting the full bridge route in AgentProfile.model.default is not a valid workaround.
It duplicates transport identity in the portable profile and CLI Bridge refuses profile materialization.

Expected

The adapter should compare the observed bridge model with the profile's materialized bridge wire identity, or otherwise normalize both identities through the same canonical function.
A completed exact-profile turn must return success.

Downstream impact

Braid /ask uses agent-eval's external optimizer callback through agent-runtime.
Until this is fixed, Braid must keep its existing finite model owner and choose Runtime's bridge executor directly for CLI Bridge analysis.

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