feat(web): add window._vellumDebug.flags.impersonateVersion debug helper#32291
Merged
dvargasfuertes merged 1 commit intoMay 27, 2026
Merged
Conversation
Adds a dev console helper for testing version-gated behavior in the web
client without rebuilding the assistant or swapping runtimes.
Usage:
window._vellumDebug.flags.impersonateVersion("0.8.6") // set + reload
window._vellumDebug.flags.impersonateVersion(null) // clear + reload
window._vellumDebug.flags.impersonateVersion() // inspect-only
Mechanism: the flag persists to localStorage and reloads. The assistant
identity store's setIdentity action consults
getImpersonatedAssistantVersion() and substitutes its value on every
write — initial identity fetch, SSE identity_changed, and the
optimistic onboarding seed all funnel through setIdentity, so the
override is uniformly applied. Every existing version gate
(useAssistantSupports, pickConversationIdWireField,
supportsServerMintedConversation, useFlagQueryFreshness, …) reads from
the store and gets the impersonated value for free, no consumer changes.
DX parallels the existing toggleTranscriptScrollController flag:
localStorage-backed, reloads on change so the world stays consistent.
Files:
- apps/web/src/lib/backwards-compat/impersonate-version-flag.ts (new)
- apps/web/src/lib/backwards-compat/impersonate-version-flag.test.ts (new)
- apps/web/src/stores/assistant-identity-store.ts (consult flag)
- apps/web/src/domains/chat/utils/debug-api.ts (expose under .flags)
- apps/web/src/domains/chat/utils/debug-api.test.ts (presence assertion)
Tests: 49/49 pass (10 new for the flag + identity-store override path).
tsc + eslint clean on touched files.
dvargasfuertes
approved these changes
May 27, 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.
What
Adds a console helper for testing version-gated behavior in the web client without rebuilding the assistant or swapping runtimes:
Why
Follow-on to #32234. Now that the web client has multiple version-gated paths (
pickConversationIdWireField,supportsServerMintedConversation,useFlagQueryFreshness,useAssistantSupports, …) and the 0.8.6 cutover is live, we want a one-liner way to validate each behavior end-to-end against a real assistant build.How
apps/web/src/lib/backwards-compat/impersonate-version-flag.ts. localStorage-backed, reloads on change. DX parallels the existingtoggleTranscriptScrollController.setIdentityconsults the override and substitutes its value on every write. Single point of indirection — initial fetch, SSEidentity_changed, optimistic onboarding seed all funnel throughsetIdentity, so every consumer ofuseAssistantIdentityStoresees the impersonated value with no consumer changes required._vellumDebug.flags.impersonateVersion.Tests
10 new tests in
impersonate-version-flag.test.ts:null/ empty string clearsPresence assertion added to
debug-api.test.ts.49/49 pass; tsc + eslint clean on touched files.
Out of scope
impersonateVersion()with no args logs+returns current value).