Assistant debug/fix affordances for errors and failing checks#161
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
josephschorr
force-pushed
the
feat/assistant-debug-fix-affordances
branch
from
July 22, 2026 23:35
30b065c to
819a79d
Compare
Add entry points that open the AI assistant and auto-submit a targeted debug prompt for a specific failure. Everything is gated on AppConfig().aiEnabled and renders/registers nothing when AI is off. Surfaces: - Inline "Ask assistant to fix" CodeLens on schema syntax errors and failed assertions, in the schema/assertions editors. - "Ask assistant to debug" button in the Watches panel for every non-passing check-watch state (denied, errored, couldn't run, missing context). - "Ask assistant to fix" action on Problems-panel error rows (schema, assertion, validation). Mechanism: a transient, non-persisted pendingPrompt on the assistant store; requestAssistantDebug(prompt, source) opens the assistant dock and stashes the prompt; a usePendingPromptConsumer hook in AssistantPanel submits it once the panel is not mid-turn (it defers only while a turn is streaming or executing tools, not on the terminal error state, so a request after a failed turn still fires). A pure debugPrompts module builds the prompts. Emits a single playground_ai_debug_requested analytics event tagged with the source surface. Covered by unit tests (prompt builders, predicate, store actions, dispatcher) and browser tests (affordance components and the pending-prompt hook, including the error-state case).
josephschorr
force-pushed
the
feat/assistant-debug-fix-affordances
branch
from
July 22, 2026 23:40
819a79d to
37831d5
Compare
samkim
approved these changes
Jul 23, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Adds one-click "Ask assistant to debug/fix" entry points that open the AI assistant and auto-submit a targeted debug prompt for a specific failure. The assistant already has the tools and full document state each turn, so this is purely the entry points plus one small new primitive.
Surfaces (all gated on
AppConfig().aiEnabled— nothing renders/registers when AI is off)registerAssertionFixespattern.How it works
pendingPrompton the assistant store (deliberately not persisted).requestAssistantDebug(prompt, source)opens the assistant dock and stashes the prompt; ausePendingPromptConsumerhook inAssistantPanelsubmits it once the panel isn't mid-turn. It defers only while a turn is actively streaming/executing tools — not on the terminalerrorstate — so a request made after a failed turn still fires.debugPrompts.tsbuilds the prompts (schema / assertion / validation / relationship errors, plus check watches), keeping wording consistent and testable.playground_ai_debug_requestedevent tagged with{ source: "editor" | "watches" | "problems" }.Tests
isDebuggableWatchStatuspredicate, the store's pending-prompt actions, and therequestAssistantDebugdispatcher.vite buildclean,oxfmt --checkclean, lint clean (no findings on changed files).The inline editor CodeLens has no automated test by design, matching the existing untested
registerAssertionFixes; its prompt output is covered by the builder unit tests.Notes
docs/superpowers/.