Skip to content

fix(tui): pass the location ref when checking connected providers - #60852

Open
YamineRL wants to merge 1 commit into
anomalyco:devfrom
YamineRL:fix/tui-connected-location
Open

YamineRL wants to merge 1 commit into
anomalyco:devfrom
YamineRL:fix/tui-connected-location

Conversation

@YamineRL

@YamineRL YamineRL commented Oct 31, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #60851

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

useConnected() read data.location.integration.list() without a location ref, so it looked at the default location instead of the TUI's current one and got []. With connected() false, the /model picker sets no category on its options, so typing a provider name matched nothing. The hook now passes useLocation().ref, like the provider and model lists in the same dialog. Every caller of useConnected() already runs inside LocationProvider.

How did you verify your code works?

  • On 2.2.0 I made the same change in the built binary: typing a provider id in /model lists all of that provider's models again. Without the change it lists none.
  • bun run typecheck in packages/tui: no type errors.
  • bun test in packages/tui: one failure ("the art stops every frame when hidden..."), and it fails the same way on dev without this change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code


Added by the opencode bot (AI-generated).

Related: #60587

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks correct: useConnected() now reads integrations for the TUI's current location, the same way the provider and model lists in the /model dialog already do. Every caller renders inside LocationProvider. When the ref isn't set yet, list(undefined) still falls back to the default location, so startup behaves as before.

I couldn't reproduce the bug. I drove the TUI with the simulated provider and a connected Exa integration on the base, opened /model and searched simulation. Both from the home screen and after /cd sub, the base already showed the provider header and matched the search. The bug seems to need the default location's integration list to be missing or stale while the TUI is somewhere else. Could you share the exact steps that lead there (for example, opening a session from another directory, a workspace, or attaching to a remote server)? Before/after screenshots of /model would also help. The connected-provider, plugin-model and app-lifecycle tests pass. Running tsc directly shows no new errors; the typecheck script itself couldn't run in my environment.

Public API: unchanged.

Note: the open PR #60591 makes the same one-line change in use-connected.tsx as part of a broader fix, so the two will conflict on this file.

Related: #60587

@GiuseppeBellamacina GiuseppeBellamacina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useConnected() now passes useLocation().ref to integration.list(), so it reads the TUI's current location instead of the default one, which matches the description. The change is minimal. I saw a mention that #60591 changes the same line, so whichever lands second will need a rebase.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tui: /model search no longer matches provider names

2 participants