Skip to content

Claude Bedrock model_used records SDK alias instead of effective route model #99

Description

@tmatup

Problem

For Claude Code runs through Bedrock, task.json.model_used can record the Claude SDK's friendly alias rather than the fully qualified route model. This makes the persisted comparison key less precise than the model that actually handled the run.

Reproduced with coder-eval 0.9.5 and 0.8.4:

  • experiment agent_config.model: eu.anthropic.claude-sonnet-5
  • exported BEDROCK_MODEL: eu.anthropic.claude-sonnet-5
  • environment_info.bedrock_model: eu.anthropic.claude-sonnet-5
  • effective Bedrock route / execution stream: eu.anthropic.claude-sonnet-5
  • persisted task.json.model_used: claude-sonnet-5
  • persisted iteration model_used: claude-sonnet-5

The same alias is exposed by AssistantMessage.model. In src/coder_eval/agents/claude_code_agent.py, _capture_assistant_message() assigns that value to sdk_model_used, which is then used as the turn/result model_used value.

Impact

Runs on distinct Bedrock routes can be grouped under a non-route-specific alias, and a campaign that pins fully qualified model IDs cannot prove that pin from the primary model_used field alone. Consumers must know to cross-check environment_info.bedrock_model and the execution stream.

Expected behavior

Persist the resolved/effective route model in the comparison-facing model_used field. If the raw SDK-reported alias is useful telemetry, preserve it separately rather than replacing the route identity.

Acceptance

  • A Claude Code Bedrock run pinned to eu.anthropic.claude-sonnet-5 records that fully qualified string as the effective comparison model.
  • The raw AssistantMessage.model alias remains available under a clearly named raw-SDK field if needed.
  • Tests cover a fully qualified Bedrock route whose AssistantMessage.model is a friendly alias.

🤖 Generated with Claude Code
Co-Authored-By: Claude

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