Skip to content

fix(portal): run VS Code BYOAI prompts in agent mode so web fetch works - #180

Merged
KB-x merged 3 commits into
mainfrom
fetch-mode
Jul 28, 2026
Merged

fix(portal): run VS Code BYOAI prompts in agent mode so web fetch works#180
KB-x merged 3 commits into
mainfrom
fetch-mode

Conversation

@KB-x

@KB-x KB-x commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What's New

Two improvements to the Open in VS Code BYOAI assistants:

  1. They can now load the JVD corpus in VS Code — Design mode returns cited, grounded answers instead of falling back to a limited, ungrounded mode.
  2. Prompts self-update — each session, the assistant refreshes itself from the published copy, so future prompt changes reach users without a manual reinstall (with a safe fallback to the copy on hand).

Why

  • The earlier change granted a fetch tool but pinned the prompt to ask mode. VS Code only attaches tools in agent mode — the ask agent ignores a tools list — so fetch was inert and the assistant reported "no web access."
  • VS Code installs the prompt to disk once, so a change to the prompt would otherwise strand everyone who installed the old copy until they manually reinstalled.

Details

  • portal/scripts/generate-snips.mjs — synthesized VS Code prompts use agent: agent with tools: ['fetch'] as the sole whitelisted tool. The explicit list replaces the default agent toolset, so the assistant gets only read-only web fetch — no file-editing, no terminal — preserving the hardened posture.
  • 17 SYSTEM_PROMPT.md bundle sources (the generated -byoai-prompt.txt is compiled from these via regenerate-bundle.sh) — added a short, non-blocking self-update step: at the start, fetch the current published version and adopt it if reachable; if the fetch fails, silently continue with the inline copy (worst case = today's behavior). Shared across all platforms — a no-op for the launch-fetch clients (GPT/Claude), a real refresh for VS Code's on-disk installs and any stale pasted copy.
  • portal/public/byoai/* — regenerated (mirrored .txt + synthesized .prompt.md).
  • portal/public/USING-BYOAI.md — security wording updated to describe the single read-only fetch capability.
  • portal/src/data/snips.json — regeneration timestamp.

Testing

  • Regenerated: 638 snips / 17 JVDs / 0 warnings.
  • bun run build — clean.
  • Verified: agent: agent + tools: ['fetch'] frontmatter, and the self-update block present in all 17 .txt and all 17 .prompt.md.

Notes

  • Follows up fix(portal): give VS Code BYOAI prompts read-only web access #179 (added the tool but under ask mode).
  • One-time reinstall still needed to pick up this change (it's the change that introduces self-update). After that, future prompt-body changes propagate automatically.
  • Only the frontmatter/permissions remain frozen on disk — that changes almost never.

@KB-x KB-x self-assigned this Jul 28, 2026
@KB-x
KB-x marked this pull request as ready for review July 28, 2026 22:14
@KB-x
KB-x merged commit 6260189 into main Jul 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant