fix(tui): make websearch provider label reactive#26943
Merged
nexxeln merged 1 commit intoMay 12, 2026
Merged
Conversation
The WebSearch component captured props.metadata into a non-reactive const
at first render. Since the component initially renders while the part is
in 'pending' state (toolprops getter returns {} for pending), the captured
snapshot was always {}, and subsequent metadata updates from the
ctx.metadata call in the websearch tool never propagated to the TUI.
The displayed label fell back to 'Web Search' instead of
'Parallel Web Search' / 'Exa Web Search'.
Convert the local to a getter function so each property read flows
through props.metadata reactively, matching the session-v2 renderer.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
sdeonvacation
added a commit
to sdeonvacation/opencode-x
that referenced
this pull request
May 12, 2026
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
Closes #26942
Type of change
What does this PR do?
The TUI's
WebSearchcomponent capturedprops.metadatainto aconst. The component first renders while the part is inpendingstate — at that point thetoolprops.metadatagetter returns{}— so the snapshot has noprovider. Solid only invokes the component once, so later metadata updates fromctx.metadata({ metadata: { provider } })never reach the JSX, andwebSearchProviderLabel(undefined)falls back to"Web Search"regardless of which provider actually ran.Switching
const metadata = props.metadatatoconst metadata = () => props.metadata(and callingmetadata()at each read) makes every access flow through Solid's reactive tracking, so the label updates when the part transitions torunning/completed. The sibling renderer atfeature-plugins/system/session-v2.tsxalready does this withcreateMemoand works correctly.How did you verify your code works?
bun test test/tool/websearch.test.ts— 10 passbun typecheckinpackages/opencode— cleanbun lint— 0 errorsOPENCODE_WEBSEARCH_PROVIDER=parallel, ran a web search, confirmed the label renders as◈ Parallel Web Search "..."instead of◈ Web Search "...". The persistedstate.metadata.providerinopencode.dbwas already correct before the fix — only the render was stale.Screenshots / recordings
Before:

◈ Web Search "latest news today"After:

◈ Parallel Web Search "latest news today 2026"(attaching shortly)
Checklist