Skip to content

Use config alias/name instead of API model ID in system prompt environment block #36164

Closed as not planned

Description

@cloud1230

Description

When users ask “What model are you using?”, the assistant answers with the internal API ID (e.g. claude-sonnet-4-20250514) instead of the config alias (my-sonnet) or display name (My Sonnet Alias).

This makes alias configuration inconsistent: users configure friendly names in config, but the model is explicitly told to identify itself by the raw provider ID.

OpenCode supports config-based model aliases:

{
"provider": {
"anthropic": {
"models": {
"my-sonnet": {
"id": "claude-sonnet-4-20250514",
"name": "My Sonnet Alias"
}
}
}
},
"model": "anthropic/my-sonnet"
}

Session metadata and the TUI already use the alias and display name. However, the system prompt in SystemPrompt.environment() always injects the API model ID:

// packages/opencode/src/session/system.ts:65
You are powered by the model named ${model.api.id}. The exact model ID is ${model.providerID}/${model.api.id}

Plugins

No response

OpenCode version

1.17.10

Steps to reproduce

  1. Add a model alias in opencode.json (see above).
  2. Start a session with anthropic/my-sonnet.
  3. Ask: “What model are you currently using?”
    Expected: My Sonnet Alias or anthropic/my-sonnet
    Actual: claude-sonnet-4-20250514 or anthropic/claude-sonnet-4-20250514

Screenshot and/or share link

No response

Operating System

windows11

Terminal

No response

Activity

  1. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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