Repository navigation
🧷 refactor: Require a Mounted Steer Host Instead of a Module Default - #17164
Merged
Merged
Conversation
berry-13
marked this pull request as ready for review
October 15, 2026 16:15
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
berry-13
added this pull request to stack #17157
October 15, 2026 16:23
berry-13
force-pushed
the
refactor/chat-steer-hostreq
branch
from
October 15, 2026 17:30
ae8fa8b to
05bf9d0
Compare
berry-13
force-pushed
the
refactor/chat-steer-hostreq
branch
3 times, most recently
from
October 18, 2026 15:42
636d809 to
d1922c9
Compare
berry-13
force-pushed
the
refactor/chat-steer-hostreq
branch
from
October 18, 2026 15:44
d1922c9 to
5e52d8d
Compare
1 task done
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.
Summary
useSteerHostfell back to a host registered withsetDefaultSteerHost, which the app called as an import side effect ofProviders/SteerHostContext.tsx. That is a module-level mutable default: a steer hook rendered outsideSteerHostProvidersilently worked through whatever the last import registered, which is the reach-for-global pattern the package should not extend.This removes
setDefaultSteerHostand its import-time call.useSteerHostnow throws a named error when no provider is mounted. Every real render path of the steer hooks is underroutes/Root.tsx, which already mountsSteerHostProvider(the share view and the standalone auth routes render none of them), so the app is unaffected. Client specs that render the steer hooks mount the app host through a smallSteerHostTestProviderinclient/test/steerHost.tsx, and the package's host spec covers the missing-provider error.Part of the stack that moves the steer hooks into the chat package; base is the previous link.
Type of change
Testing
Tested environments/configuration:
Local jest and typecheck; no runtime configuration matters for this change.
Automated tests:
cd client && npx jest src: the full client suite, 791 suites, 12,048 tests pass.cd packages/chat && npx jest src/react/steer: host spec covers the nearest provider and the missing-provider error.npx tsc --noEmitforclientandpackages/chat: clean. ESLint, Prettier and import sorting clean on every changed file.Screenshots / recordings
No user-facing change.
Risk / compatibility
Low. A steer hook rendered outside the provider now fails loudly instead of using a registered default; the full client suite and a grep of render paths found none outside
Root.Checklist