fix(agent): remove alphabetical sort to preserve insertion order for primary agents - #34841
fix(agent): remove alphabetical sort to preserve insertion order for primary agents#34841Cretezy wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Found potentially related PRs:
These PRs suggest there has been prior discussion about controlling agent tab order. Your PR takes a simpler approach by preserving insertion order instead of requiring explicit configuration. Verify whether these older PRs were closed/rejected in favor of the approach your PR implements. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Still a problem |
Issue for this PR
Closes #7372
Type of change
What does this PR do?
Removes the secondary alphabetical sort from
Agent.list()so primary agents appear in insertion order (built-in first, then user-defined in config declaration order).Previously, adding a custom "home" agent caused the TUI tab order to become "build" -> "home" -> "plan" instead of the expected "build" -> "plan" -> "home" because
h < palphabetically. Removing the[(x) => x.name, "asc"]sort criterion restores the user's intended ordering.This PR does not add an explicit ordering field (e.g.
order: number) for agents. It simply relies on declaration order in the config, which is the simpler fix and sufficient for the current use case.How did you verify your code works?
packages/opencode/src/agent/agent.ts—list()now sorts only by default agent priority, preserving insertion order for the rest.Screenshots / recordings
N/A
Checklist