Repository navigation
Make workbench test state transitions explicit - #132
Merged
Merged
Conversation
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
The AI model test workbench tracked request ownership with a mix of module-level variables and per-message flags. This made several transitions implicit: approval continuations kept the previous request id, stale stream snapshots could overwrite newer state, RAG could flip a stopped message back to done, external tool submissions could be sent twice, and the selected test mode was lost on refresh.
This change introduces a small message state machine and an explicit active request id for the chat and RAG flows, while keeping the existing public composable contract additive.
Changes
model-test-workbench-message-state.tswithbeginAssistantMessage,resumeAssistantMessage, andapplyAssistantMessageEventfor thestreaming -> done | stopped | errortransitions.requestIdper chat/RAG request. Stream snapshots, terminal errors, and cleanup now ignore stale requests.modequery parameter. An explicit mode is authoritative;chatremains the default and clears the parameter.User-visible behavior
?mode=rag,?mode=embedding, etc.).Reproduction
Before the fix:
The message remained in the done state, no continuation content appeared, and stopping had no effect.
After the fix, the approved message switches to streaming, receives the continuation, and can be stopped. The regression is covered by the approval continuation test in
streaming-tests.test.ts.Validation
pnpm test:unit: 68 files, 597 tests passedpnpm exec vue-tsc --build: passedpnpm lint: 0 warnings, 0 errorspnpm build: passedgit diff --check: cleanNo live Halo browser E2E was run; verification is source-level plus unit/integration tests and a production build.
Compatibility
The changes are limited to the Console workbench UI. Backend DTOs, persisted extension fields, generated API clients, and plugin SDK contracts are unchanged. Additions to the workbench composable return value are optional/additive.