Repository navigation
feat(studio): AI chat context is opt-in (last run, widget tree), redacted; backend for a selector fix - #467
Merged
Merged
Conversation
…gestSelectorFix returns one ProbeScript line The chat's system prompt now carries the failures of the last run (tests and steps, with their lines and errors) and, when a device is connected, its widget tree, each cut to a size limit and marked when cut. The key still comes only from the keychain. SuggestSelectorFix asks for one ProbeScript line that replaces the last failed step; nothing is applied. The Go tests use a fake provider. The pane button is a follow-up.
…es, a visible line, redaction The last run and the device's widget tree now reach the AI provider only when the workspace turns them on: two switches under studio.ai_context in probe.yaml, both off by default, shown in the Workspace settings overlay. While either is on, a line above the chat input says what is sent. The Go side reads the same file, fails closed when it cannot, and does not ask the device for its tree when the switch is off. The widget tree and the run text are redacted first: obscured or secret-looking editable fields lose their keys, and API keys, GitHub tokens, Bearer values and long hex or base64 runs are removed. The Workspace settings overlay now reads and writes the workspace root, not the folder being browsed. SuggestSelectorFix needs the run-results switch and returns one ProbeScript line; its button and Wails bindings follow in a separate change.
…or-fix # Conflicts: # CHANGELOG.md # website/src/content/docs/advanced/configuration.md
2 of 3 tasks
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
probe.yamlunderstudio.ai_context(run_results,widget_tree) and in the Workspace settings overlay, under AI chat context.probe.yamlfor every chat turn, and it fails closed. With no workspace, an unreadable file, or a switch that is off, nothing beyond the open file is sent, and the device is not asked for its tree.sk-…,ghp_…, Bearer values, long hex and base64 runs) becomes[redacted]in the tree and in the run text. Each part is cut to its size limit and marked when it is cut.SuggestSelectorFix(backend only) asks for one ProbeScript line that replaces the last failed step. It needs the run-results switch and refuses without it. Nothing is applied. The pane button, and the regenerated Wails bindings for it, are a follow-up.probe.yaml, not the folder currently browsed in the file pane. The toggles and the chat line therefore use the same file as the Go side. The fields the overlay already managed are unchanged.What the widget tree contains today (please review)
The agent's
probe.dump_treereturns widget types andValueKeys. It does not return the text typed into fields, so typed text is not in the tree today. The agent writes no "obscured" marker either, so the obscured rule has nothing to match yet; the secret-name and credential rules do apply. Writing an obscured marker into the agent's dump is the follow-up that would make the obscured rule effective.Test plan
go test ./studio/on the whole package, merged withorigin/main, with the real frontend build embedded. The new tests cover: off by default (no probe.yaml, no key, no workspace); neither part is sent and the device is not asked when both are off; each switch sends only its own part; both on sends both, redacted; no secret reaches the prompt; SuggestSelectorFix needs the run switch; redaction of common credential shapes; redaction of obscured and secret-named editable fields; probe.yaml save and load keep the switches and the rest of the file, and switching both off removes the section; astudiokey that is not a map is refused and the file is left alonego vet ./studio/, and gofmt for the new Go filesnpm run build(tsc and vite build) on the merged tree🤖 Generated with Claude Code