Skip to content

[Bug]: Remote delegate_task ignores target.driverKind and runs the requested model on the caller's provider instance #34778

Closed

Description

@vanakema

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Have two linked environments, A and B. Both have a Claude provider instance (claudeAgent) and a Codex provider instance (codex).

  2. In a Claude thread on A, call delegate_task aimed at B, naming the provider by driver kind only:

    {
      "task": "Reply with the single word: ok. Do not run any tools.",
      "target": {
        "environmentId": "<B>",
        "projectId": "<a project on B>",
        "driverKind": "codex",
        "model": "gpt-6.1-sol",
        "options": { "reasoningEffort": "low" }
      }
    }
  3. Look at providerInstanceId in the tool result, or at the child thread on B.

  4. Repeat with "providerInstanceId": "codex" in place of "driverKind": "codex".

Expected behavior

driverKind: "codex" resolves to B's Codex instance, as it does for a local delegate, or the call is rejected because the model does not belong to the resolved instance.

Actual behavior

The child thread on B is created on the caller's instance, claudeAgent, with the Codex model and Codex options kept:

step 2 (driverKind: "codex"):          "providerInstanceId":"claudeAgent","model":"gpt-6.1-sol"
step 4 (providerInstanceId: "codex"):  "providerInstanceId":"codex","model":"gpt-6.1-sol"

The stored thread on B has modelSelection: {"instanceId":"claudeAgent","model":"gpt-6.1-sol","options":[{"id":"reasoningEffort","value":"medium"}]}, and the Claude Agent SDK session is opened with model: "gpt-6.1-sol".

Nothing reports the mismatch. With a stock Claude setup the run would presumably fail on an unknown model. Behind an LLM gateway that serves both model families it runs: the GPT model is driven through the Claude Code harness instead of Codex. That is how this was noticed, because Claude Code then warns that auto mode's server-side classifier is unavailable for the session.

The agent that hit this had called orchestrator_capabilities first and passed a provider and model taken from its output, so the call followed the documented usage.

Impact

Major degradation or frequent failure

Version or commit

Caller 0.1.8 → target 0.1.6 (original occurrence, five threads); caller 0.1.6 → another target (minimal repro above)

Environment

macOS on all machines, environments linked over Tailscale HTTPS. Claude Code 2.1.322. Providers: claudeAgent and codex (existing CLI) on both ends.

Logs or stack traces

Provider event log on the target for the child thread:

{"direction":"outgoing","payload":{"type":"query.open","options":{"model":"gpt-6.1-sol","tools":{"type":"preset","preset":"claude_code"},"permissionMode":"auto", ...}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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