feat(console,src-tauri): local "Config folder" setting (studio#128) - #130
Merged
Conversation
Adds a "Config folder" field to the Debug drawer's Config tab — a user-picked local directory (native folder picker via tauri-plugin-dialog) that later work will mirror each agent's generated config.toml into (<folder>/<agent-name>/config.toml, alongside the existing S3 upload provision_agent/provision_agent_k8s already do — unchanged) and that the "view an agent's config" screen (also studio#128, separate follow-up) will read from directly, no S3 round-trip. This slice is just the setting itself: plugin registration + capability grant (dialog:allow-open — the app's capabilities/default.json had no dialog permission at all before this) + picker UI, persisted like the existing theme/log-level settings (localStorage), not Tauri's hidden app-config-dir — this setting points at other local files, so storing it in the hidden config dir would just be an extra layer of indirection. Wiring the wizard/view-screen to actually use it lands with those pieces. Verification: npm run typecheck clean, npm test 106/106 passing, npm run build succeeds. Rust side (plugin registration, Cargo.toml) not locally compiled — same pre-existing limitation as every other Rust change this week; tauri-plugin-dialog's exact API (invoke command name "plugin:dialog|open", options shape, return type for directory+non-multiple mode) was checked against the plugin's actual TypeScript source before using it, not guessed. Ref #128.
brettchien
added a commit
that referenced
this pull request
Aug 29, 2026
…ly (studio#128) (#134) Last item on #128's runbook. New Debug drawer tab, next to the existing Activity/MCP/Config ones — lists agent names under the local "Config folder" (#130) that have a config.toml, and shows the selected one's content read-only. Deliberately local-filesystem-only, no S3 (Brett: "forget about s3 now"): list_local_agent_configs/read_local_agent_config are plain std::fs calls in src-tauri, no sidecar/MCP tool involved at all, unlike everything else added this batch — the local folder is Studio's own mirror the New Fleet wizard writes alongside its S3 upload (still to be wired — the wizard itself doesn't write here yet, this PR is just the read side), not a read-through to the S3 source of truth. Whatever an admin agent (or the wizard, once wired) writes into the same folder shows up on the next Refresh / tab switch — reading a directory needs no separate sync mechanism. Agent names render via DOM construction (createElement + textContent), not innerHTML string concatenation — they come from local directory listings, not worth trusting as HTML even though the risk is low (Studio itself controls what gets written there today). Verification: npm run typecheck clean, npm test 100/100 passing, npm run build succeeds. Rust side not locally compiled — same pre-existing limitation as every other Rust change this week, though this one is lower risk than most (plain std::fs, no new dependency, no capability grant needed — custom commands aren't plugin-gated the way tauri-plugin-dialog was in #130). Ref #128 — this closes out the runbook's item list (the wizard→folder write side is a natural follow-up once someone needs it, not blocking).
brettchien
added a commit
that referenced
this pull request
Aug 29, 2026
…35) (#136) Closes the gap #134 flagged: the wizard generated config.toml server-side but never wrote it into the operator's local Config folder (#130), so the "Agent configs" view (#134) had nothing to show until something else populated the folder by hand. Brett's explicit ordering: "Wizard should write to local first, write to s3 if needed." That ordering can only actually be guaranteed inside the sidecar (oab-mcp) — provision_agent/provision_agent_k8s are what do the S3 upload, so writing the local copy there, before the upload, is a real sequencing guarantee. Having the console write a local copy *after* receiving the tool's response back would mean S3 had already happened first no matter what, the opposite of what was asked — and was the implementation this session's own earlier #135 write-up had assumed by default, corrected here after asking Brett directly rather than guessing. - studio-cp: new write_local_agent_config() — <folder>/<name>/config.toml, written from generate_agent_config()'s raw output *before* inject_pre_seed_hook mutates a copy for the S3/bundle path (the S3 zip URI hook injects is meaningless for a local reference copy). Both provision_agent and provision_agent_k8s gained a local_config_folder: Option<&str> parameter; write happens unconditionally whenever the caller passes one, hard-fails the whole deploy on a write error (folder set = a real requirement, not best-effort) rather than silently proceeding without the copy it promised. - oab-mcp: deploy_provision_agent's schema gained local_config_folder (optional). - src-tauri: bridge command threads the new param through. - console: deploy.ts reads the same oab-studio.configFolder localStorage key the Config-folder setting (#130) already uses and sends it along. This also resolves the mechanism question #135's own write-up had left open (send config_toml back to console vs. have the sidecar write directly) — the ordering requirement settles it: only the sidecar-writes approach can guarantee local-before-S3, so no config.toml text (which could contain secret *references*, if not raw values) needs to cross the Tauri IPC bridge back to the console at all. Ref #135.
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
Item 8 of #128's runbook. Adds a "Config folder" field to the Debug drawer's Config tab — a user-picked local directory (native folder picker via
tauri-plugin-dialog) that later work will mirror each agent's generated config.toml into (<folder>/<agent-name>/config.toml, alongside the existing S3 upload — unchanged) and that the "view an agent's config" screen (separate follow-up, also #128) will read from directly, no S3 round-trip.This slice is just the setting itself — plugin registration + capability grant + picker UI. Wiring the wizard/view-screen to actually use it lands with those pieces.
Change
src-tauri:tauri-plugin-dialog = "2"dependency +.plugin(tauri_plugin_dialog::init())registration +dialog:allow-opencapability grant incapabilities/default.json(had no dialog permission at all before this — would have been a silent runtime failure without it).console: new "Config folder" section in the Config tab (index.html), wired inmain.tsviainvoke("plugin:dialog|open", { options: { directory: true } })— checked the plugin's actual TypeScript source for the exact invoke command name, options shape, and return type (string | nullfordirectory: truewithoutmultiple) rather than guessing. Persisted like the existing theme/log-level settings (localStorage), not Tauri's hidden app-config-dir — this setting points at other local files, so hiding it in the app-config-dir would just be indirection for no reason.Verification
npm run typecheckclean,npm test106/106 passing,npm run buildsucceeds.aws-sdk-ec2/no-macOS-libs limitation as every other Rust change this week.Ref #128.
🤖 Generated with Claude Code