Skip to content

Remove hardcoded codex role models; add role_model config - #161

Merged
yourconscience merged 8 commits into
mainfrom
fix/model-neutral-roles
Sep 6, 2026
Merged

Remove hardcoded codex role models; add role_model config#161
yourconscience merged 8 commits into
mainfrom
fix/model-neutral-roles

Conversation

@yourconscience

@yourconscience yourconscience commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary by Sourcery

Remove hardcoded model assignments from built-in roles and support configurable, harness-aware model selection through role_model.

New Features:

  • Add centralized role_model configuration for pinning a default model across rendered roles without explicit model settings.

Bug Fixes:

  • Prevent legacy Claude model tier aliases from leaking into Codex, OpenCode, and Qwen configurations, allowing those harnesses to use appropriate defaults.

Enhancements:

  • Preserve exact configured model identifiers across supported rendering targets while retaining explicit role and per-harness model overrides.

Documentation:

  • Update role model documentation to describe Codex tier handling and centralized role_model configuration.

Tests:

  • Add coverage for configured model propagation, omitted Codex models, alias neutralization, and target-specific model rendering.

Chores:

  • Remove hardcoded model and effort settings from the built-in role definitions.

@sourcery-ai

sourcery-ai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR removes model assumptions from bundled roles and Codex rendering, introduces an optional per-agent role_model override applied only when roles lack an explicit model, documents the new configuration behavior, and updates tests for direct model propagation and model omission.

Sequence diagram for role model resolution and Codex rendering

sequenceDiagram
    participant Config as dotagents.yaml
    participant Renderer as renderAgentRole
    participant Role as agentRole
    participant Codex as renderCodexAgentRole
    participant Output as Codex role TOML

    Config->>Renderer: load agentConfig.RoleModel
    Renderer->>Role: inspect Model
    alt role.Model is empty and RoleModel is configured
        Renderer->>Role: apply agent.RoleModel
    end
    Renderer->>Codex: renderCodexAgentRole(role)
    Codex->>Role: read Codex.Model
    alt Codex.Model is empty
        Codex->>Role: read Model
    end
    Codex-->>Output: emit resolved model or omit model
Loading

File-Level Changes

Change Details Files
Make starter roles model-neutral and add a per-agent configuration override for rendered role models.
  • Remove hardcoded model and effort frontmatter from the five bundled roles.
  • Add optional role_model YAML configuration to agent entries and apply it when a role has no explicit model.
  • Document that omitted models use each harness default and role_model is the central pinning mechanism.
README.md
agents/architect.md
agents/builder.md
agents/researcher.md
agents/reviewer.md
agents/tester.md
cmd/dotagents/main.go
cmd/dotagents/agents.go
Stop translating Claude-style model names into Codex model identifiers and preserve model omission in Codex output.
  • Use the role's configured model directly for Codex when no Codex-specific override exists.
  • Remove the codexModelFor hardcoded mapping and default.
  • Omit Codex model and reasoning-effort fields when neither role nor override supplies them.
cmd/dotagents/agents.go
cmd/dotagents/agents_test.go
Update renderer tests to cover configurable models and model-neutral Codex roles.
  • Replace hardcoded Codex model expectations with a custom test model.
  • Add coverage for omitted Codex model fields and role_model prefill behavior.
cmd/dotagents/agents_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: fcaf4a72-4c11-4ff0-92d1-8d8a42a93b8a


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="cmd/dotagents/agents.go" line_range="410" />
<code_context>
 	model := strings.TrimSpace(role.Codex.Model)
 	if model == "" {
-		model = codexModelFor(role.Model)
+		model = strings.TrimSpace(role.Model)
 	}
 	effort := strings.TrimSpace(role.Codex.ModelReasoningEffort)
</code_context>
<issue_to_address>
**issue (broader_impact):** Legacy roles that still declare canonical models such as `opus`, `sonnet`, or `haiku` are emitted to Codex with those names unchanged. Codex previously translated these aliases through `codexModelFor`, so those roles now fail when Codex rejects the unsupported model identifier.

**Triggers:** When an existing custom role or an imported role retains a non-empty canonical model value.

**Suggested fix:** Preserve a compatibility mapping for legacy canonical aliases, or migrate/validate existing role models before rendering them for Codex.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: cmd/dotagents/agents.go:410


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread cmd/dotagents/agents.go Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4743dd9660

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/dotagents/agents.go
Comment thread cmd/dotagents/agents.go Outdated
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 6, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb78b13f5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/dotagents/agents.go
@sourcery-ai
sourcery-ai Bot dismissed their stale review September 6, 2026 13:57

Sourcery withdrew this approval because the latest commits introduced blocking findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d736ad4d18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/roles.md
Comment thread docs/roles.md
@yourconscience
yourconscience merged commit 9b77de0 into main Sep 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant