fix: use display name in runtime-fallback retry#2891
fix: use display name in runtime-fallback retry#2891code-yeongyu merged 1 commit intocode-yeongyu:devfrom
Conversation
|
All contributors have signed the CLA. Thank you! ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
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: Fixes agent identification error in runtime-fallback retry by using display names instead of internal keys. Verified by test updates.
29fbe59 to
b4d4d30
Compare
|
recheck |
|
@cubic-dev which path is better using the display name or the id? |
@RaviTharuma In the current architecture of Opencode, using the display name (which often acts as the registration key) is the correct path because that is what the backend uses as the primary identifier. The Trade-off
Recommendation for this PRThe current solution using Long-term improvement:
Since the immediate goal is to fix the "Agent not found" error during runtime-fallback, your change is the pragmatic and correct way to align with the existing SDK behavior. For more details on how agents are registered and identified, you can check the Core Architecture or the repository learnings regarding agent configuration. |
|
So we should take the display name because OpenCode itself does not even use the ID. |
@RaviTharuma Exactly. To clarify, what we call the "ID" or "slug" internally (like So, while using a stable, machine-readable ID is the better engineering practice for the long term, it isn't currently an option without changing how the backend identifies agents. This matches our repository learnings which note that agents are identified by their registration record key rather than a specific ID property. Your current fix is the correct way to handle this given the current architecture. |
code-yeongyu
left a comment
There was a problem hiding this comment.
Correct fix. The promptAsync call needs display name format (e.g., "Sisyphus (Ultraworker)") not config key ("sisyphus"), same pattern as how OpenCode registers agents. Test update is also correct. LGTM.
Fixes #2882
When runtime_fallback is enabled and a retryable error occurs, the retry mechanism was using the original agent name (e.g. 'sisyphus') instead of the remapped display name (e.g. 'Sisyphus (Ultraworker)').
This caused the error: "Agent not found: 'sisyphus'. Available agents: Sisyphus (Ultraworker), Atlas (Plan Executor)..."
Changes:
The fix ensures that when retrying with a fallback model, the agent name is properly converted to its display name format before being passed to the API.
Summary by cubic
Fixes #2882. Use the agent display name during runtime-fallback retries so the API can find the agent and the retry succeeds.
getAgentDisplayNamebefore callingpromptAsync.Written for commit b4d4d30. Summary will update on new commits.