feat(desktop): Config tab to pin oab-mcp target + reload core - #10
Open
brettchien wants to merge 1 commit into
Open
feat(desktop): Config tab to pin oab-mcp target + reload core#10brettchien wants to merge 1 commit into
brettchien wants to merge 1 commit into
Conversation
The desktop spawned oab-mcp with only OAB_CLUSTER, so the sidecar
inherited the host's ambient AWS credential chain — silently pointing
Studio at the wrong account/region (deploy_list AccessDenied on a
cluster that doesn't exist in that account). This adds an explicit,
persisted connection target and a way to change it without restarting
the app.
- config.rs: McpConfig { cluster, profile?, region? }, persisted to the
app config dir (mcp-config.json); env-seeded defaults on first run.
- mcp.rs: spawn() takes the config and builds a *curated* child env —
inherit parent env minus all AWS_*, then re-inject the configured
AWS_PROFILE / AWS_REGION so a stale ambient AWS_ACCESS_KEY_ID can't
outrank the profile. Child is now killable for reload (shutdown()).
- lib.rs: get_config / set_config commands; set_config persists then
kills+respawns the core; deploy_list defaults to the configured cluster.
- console: third "Config" tab with a profile/region/cluster form; save
invokes set_config and refreshes the roster against the new target.
v1 is a single target; shaped to grow into a multi-fleet registry.
Verified: console typecheck + tests + build green. Rust API checked
against pinned crate sources; not compiled here (ECS container lacks the
GTK/WebKit system libs Tauri needs) — needs a host cargo build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Aug 10, 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 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.
Why
The
deploy_listAccessDeniedExceptionBrett hit wasn't a missing IAM policy — it was credential/region drift. The desktop spawned theoab-mcpsidecar with onlyOAB_CLUSTER, so it inherited the host's ambient AWS default chain and pointed at the wrong account/region (916371022086/ap-southeast-1), where theoabcluster doesn't exist. The cluster actually lives in504190915686/ap-east-2.Fix: make each oab-mcp's target explicit and persisted, and let the user change it from the UI without restarting the app.
What
src-tauri/src/config.rs(new) —McpConfig { cluster, profile?, region? }, persisted to the app config dir asmcp-config.json. First-run defaults seed from the process env so behaviour is unchanged until the user saves.src-tauri/src/mcp.rs—spawn()takes the config and builds a curated child env: inherit the parent env minus everyAWS_*, then re-inject the configuredAWS_PROFILE/AWS_REGION(+AWS_DEFAULT_REGION). This is deliberate: a stale ambientAWS_ACCESS_KEY_IDwould otherwise outrankAWS_PROFILEin the SDK chain and re-introduce the drift. The child is now held in anOptionand killable viashutdown()for reload.src-tauri/src/lib.rs—get_config/set_configcommands.set_configpersists, then kills + respawns the core with the new env.deploy_listnow defaults to the configured cluster. Config is loaded into managed state at startup.console/— third Config tab (index.html,config.ts,styles.css): a profile / region / cluster form. Save callsset_config, then refreshes the roster against the new target. Browser build disables the form.v1 is a single target, shaped to grow into a multi-fleet registry (provider-tagged connections) — the direction discussed in the thread.
Verification
npm run typecheck,npm test(8/8),npm run build— all green.glib-sysbuild fails on missingglib-2.0.pc). I verified every external API against the pinned crate sources instead:Command::env_clear()/envs<I,K,V>/sidecar() -> Command— tauri-plugin-shell 2.3.5CommandChild::kill(self)— samePathResolver::app_config_dir() -> Result<PathBuf>,Manager::path()— tauri 2.11.5new_config↔newConfig) — tauri-macros 2.6.3cargo build/cargo checkinsrc-tauri/on the host to confirm the compile.How to test on the host
cargo tauri devor the bundled build).brettchien, regionap-east-2, clusteroab→ Save & reload core.config saved — reloading core…then a fresh spawn; roster should list theoabservices (oab-prod-mira,oab-prod-orca) instead of the AccessDenied error.mcp-config.jsonin the app config dir).🤖 Generated with Claude Code