fix(app): tolerate incomplete agent configuration - #44025
Closed
OpeOginni wants to merge 2 commits into
Closed
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
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.
Issue for this PR
Fixes #44023
Type of change
What does this PR do?
Fixes a whole-app crash on desktop when a connected server runs an older opencode version.
normalizeAgentListreadsagent.request.settings.temperatureunguarded. Servers built before 140224b (2026-07-02) serialize agents asrequest: { headers, body }withoutsettings, the client stores API responses without validation, and the normalizer runs inside a reactive computation during bootstrap — so the TypeError escapes to the root error boundary and the app never loads. Restarting refetches the same response and crashes again.The fix defaults the missing fields (
agent.request?.settings ?? {},agent.permissions ?? []) so a malformed agent degrades to default temperature/topP instead of killing the app. Output is unchanged for well-formed agents.How did you verify your code works?
normalizeAgentList— they throw the reported TypeError before the fix and pass after (bun test src/runtime/server/global-sync/utils.test.ts).opencode-ai@0.0.0-beta-202607011659 serve, confirmed its/api/agentreturnsrequestwithoutsettings, and that the desktop app loads fine against it with this fix.bun run typecheckin packages/app passes.Screenshots / recordings
Checklist