Skip to content

Conversation

@CasualDeveloper
Copy link
Contributor

@CasualDeveloper CasualDeveloper commented Jan 7, 2026

Summary

Complete implementation for #7138 (agent-level default variant support) with TUI and desktop support.

Adds variant field to agent config, allowing users to set a default variant per agent:

# .opencode/agent/oracle.md
---
model: anthropic/claude-sonnet-4
variant: "high"
---

Priority order: user --variant selection > agent config > none

Comparison with PR #7140

Both PRs implement the same core feature. This PR adds:

Feature PR #7140 This PR
Core backend logic
TUI display
Desktop/web app
Message metadata ⚠️ undefined when agent default used ✅ Stores resolved variant
OpenAPI schema
Files changed 9 14

Key differences

1. Desktop support (this PR only)

  • packages/app/src/context/local.tsx: Added effective() method
  • packages/app/src/components/prompt-input.tsx: Uses effective() for display and API calls, shows variant in agent selector

2. prompt.ts change (this PR only)

Stores the resolved variant in message metadata:

// PR #7140 (stores user input only):
variant: input.variant,

// This PR (stores resolved value):
variant: input.variant ?? agent.variant,

Without this, inspecting message history shows variant: undefined when the agent's default variant was actually used.

Changes

Backend

  • Add variant field to agent config schema (config.ts, agent.ts)
  • Resolve variant in llm.ts: input.user.variant ?? input.agent.variant
  • Store resolved variant in message metadata (prompt.ts)
  • Subagents use their own configured variant (task.ts)

TUI

  • Add effective() method to local.tsx
  • Display effective variant in prompt bar (prompt/index.tsx)
  • Show variant in agent picker dialog (dialog-agent.tsx)

Desktop

  • Add effective() method to local.tsx
  • Display effective variant in prompt bar (prompt-input.tsx)
  • Show variant in agent selector dropdown (prompt-input.tsx)

SDK

  • Update types.gen.ts and openapi.json

Examples

  • Add variant: "high" to triage.md and duplicate-pr.md

Closes #7138

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicates Found

PR #7140: Add default variant config per agent
#7140

Why related: This is the primary implementation that the current PR (#7156) is an alternative version of. According to the PR description, #7156 is an alternative implementation for #7138 that includes additional changes not present in #7140, specifically:

  • Fallback to agent.variant for message metadata in prompt.ts
  • Clarifying comment explaining subagent variant design choice in task.ts

The PR author explicitly states they're "happy to close this if #7140 incorporates these changes," indicating these are addressing the same feature with slightly different approaches.

@rekram1-node
Copy link
Collaborator

@CasualDeveloper we can do ur change if u want but I think ti requires updates to both tui AND desktop

@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch 3 times, most recently from 11edba0 to 9cc62c8 Compare January 8, 2026 05:59
@CasualDeveloper CasualDeveloper marked this pull request as ready for review January 8, 2026 05:59
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from 9cc62c8 to ae2dd3e Compare January 8, 2026 06:14
@CasualDeveloper
Copy link
Contributor Author

Thanks @rekram1-node! I've updated this PR to include both TUI and desktop support:

TUI: local.tsx, prompt/index.tsx, dialog-agent.tsx
Desktop: local.tsx, prompt-input.tsx

Both now have:

  • effective() method that returns current() ?? agent.current()?.variant
  • Variant display in prompt bar
  • Variant shown in agent selector

The prompt.ts change is backend-only and works for all clients automatically.

Ready for review when you have time!

@CasualDeveloper CasualDeveloper changed the title feat: add agent-level default variant support (alternative implementation) feat: add variant support for subagents #7138 (alt pr to #7140) Jan 8, 2026
@CasualDeveloper CasualDeveloper changed the title feat: add variant support for subagents #7138 (alt pr to #7140) feat: add variant support for subagents (#7138, alt pr to #7140) Jan 8, 2026
@CasualDeveloper CasualDeveloper changed the title feat: add variant support for subagents (#7138, alt pr to #7140) feat: add variant support for subagents (#7138) [alt of #7140] Jan 8, 2026
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from ae2dd3e to 1ce1c53 Compare January 9, 2026 08:08
- Add variant field to agent config schema
- Resolve variant with priority: user selection > agent config > none
- Display effective variant in TUI and desktop prompt bar
- Show variant in agent selector (TUI dialog + desktop dropdown)
- Subagents use their own configured variant (not inherited from parent)
- Store resolved variant in message metadata (prompt.ts)
- Add variant examples to triage and duplicate-pr agents

Closes anomalyco#7138
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from 1ce1c53 to c3fbc31 Compare January 9, 2026 23:15
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.

feat: Support default variant configuration per agent

2 participants