feat(agent-priority): inject order field for deterministic agent Tab cycling#2833
Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom Mar 25, 2026
Merged
Conversation
…cycling Inject an explicit `order` field (1-4) into the four core agents (Sisyphus, Hephaestus, Prometheus, Atlas) via reorderAgentsByPriority(). This pre-empts OpenCode's alphabetical agent sorting so the intended Tab cycle order is preserved once OpenCode merges order field support (anomalyco/opencode#19127). Refs anomalyco/opencode#7372
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Injecting an 'order' field is a safe, additive change. It restores intended behavior following upstream changes and is designed to be backwards compatible.
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
orderfield (1-4) into four core agents so Tab cycling order is preserved after OpenCode 1.3.0+ alphabetical sortingProblem
OpenCode 1.3.0 introduced alphabetical agent sorting (#18261), which overrides oh-my-opencode's intended agent order. Tab cycle changed from
Sisyphus → Hephaestus → Prometheus → AtlastoSisyphus -> Atlas → Hephaestus → Prometheus.The existing
reorderAgentsByPriority()only controlled object insertion order, which OpenCode'ssortByignores.Solution
Refactored
reorderAgentsByPriority()to inject anorderfield into each core agent config:The
orderfield is part of the upstream PR (anomalyco/opencode#19127, refs #7372). Until merged, the field is harmlessly ignored by OpenCode.Changes
src/plugin-handlers/agent-priority-order.ts: RefactoredCORE_AGENT_ORDERto carryordervalues, addedinjectOrderField()helpersrc/plugin-handlers/agent-config-handler.test.ts: Updated test expectation to include injectedorderfieldSummary by cubic
Adds an explicit order field to core agents to enforce deterministic Tab cycling despite OpenCode 1.3.0 alphabetical sorting. Prepares for upstream order support so the order applies automatically when available and is a no-op until then.
reorderAgentsByPriority()to injectorderviainjectOrderField().orderon builtin Sisyphus.Written for commit 5befb60. Summary will update on new commits.