v1.39.2.0 feat: GSTACK_* env-shim for Conductor + gbrain/gstack setup docs#1534
Open
garrytan wants to merge 4 commits into
Open
v1.39.2.0 feat: GSTACK_* env-shim for Conductor + gbrain/gstack setup docs#1534garrytan wants to merge 4 commits into
garrytan wants to merge 4 commits into
Conversation
New lib/conductor-env-shim.ts promotes GSTACK_ANTHROPIC_API_KEY and GSTACK_OPENAI_API_KEY to canonical names when canonical is empty. Wired into the four TS entry points that hit paid APIs or gbrain embeddings: gstack-gbrain-sync.ts, gstack-model-benchmark, preflight-agent-sdk.ts, test/helpers/e2e-helpers.ts. Side-effect-only import, 15 lines total. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
USING_GBRAIN_WITH_GSTACK.md: new "What you get after setup" section, Path 4 (remote MCP / split-engine), /sync-gbrain workflow stages + watermark mechanics, "Conductor + GSTACK_* env vars" section, env vars table extended, two troubleshooting entries (silent embedding failure and FILE_TOO_LARGE watermark block). CONTRIBUTING.md "Conductor workspaces": new paragraph on the GSTACK_* prefix pattern and the four entry points importing the shim. VERSION 1.39.1.0 → 1.39.2.0 and CHANGELOG entry covering the shim + docs (full release-summary format with before/after table). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refactor lib/conductor-env-shim.ts to export promoteConductorEnv() so unit tests can manipulate env and call it directly (a bare side- effect IIFE on import isn't reachable from bun:test once cached). The on-import IIFE still runs — existing four-entry-point imports keep working unchanged. test/conductor-env-shim.test.ts covers all three branches: GSTACK_FOO present + FOO empty → promotion; FOO already set → no-overwrite; nothing in env → no-op. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
E2E Evals: ✅ PASS0/0 tests passed | $0 total cost | 12 parallel runners
12x ubicloud-standard-8 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite |
The prior docs framed the GSTACK_* prefix as collision-avoidance: "Conductor exposes API keys under a GSTACK_ prefix so it never collides with whatever the host system has set." That understates the mechanism — Conductor actively strips ANTHROPIC_API_KEY and OPENAI_API_KEY from every workspace's process env, so setting them in ~/.zshrc or .env doesn't help. The fix path is to set the GSTACK_-prefixed forms in Conductor's workspace env config; Conductor passes those through untouched. Three docs updated to reflect the strip, not the polite framing: USING_GBRAIN_WITH_GSTACK.md (Conductor section), CONTRIBUTING.md (Conductor workspaces paragraph), CHANGELOG.md (release summary). README.md gains a "Running gstack in Conductor?" callout in the GBrain section pointing at the canonical doc's anchor, plus a fourth path entry (remote gbrain MCP / split-engine) that was already documented in USING_GBRAIN but missing from the README summary. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Three commits land Conductor compatibility for paid-API entry points plus the docs that explain it:
Code
feat: GSTACK_* env-key shim for Conductor workspaces(506ed6b) — newlib/conductor-env-shim.tspromotesGSTACK_ANTHROPIC_API_KEY/GSTACK_OPENAI_API_KEYto canonical names when canonical is empty. Imported as a side effect from the four TS entry points that hit Anthropic/OpenAI:bin/gstack-gbrain-sync.ts,bin/gstack-model-benchmark,scripts/preflight-agent-sdk.ts,test/helpers/e2e-helpers.ts.test: unit coverage for conductor-env-shim(93c8a8a) — refactored the shim to exportpromoteConductorEnv()so unit tests can manipulate env and call it directly. Four tests cover all three branches (promote, no-overwrite, no-op).Docs
docs: gbrain+gstack setup, Conductor env mapping (v1.39.2.0)(6d7dad2) — new sections inUSING_GBRAIN_WITH_GSTACK.md(What you get, Path 4 / split-engine,/sync-gbrainworkflow, Conductor + GSTACK_* env vars, two troubleshooting entries). New paragraph inCONTRIBUTING.md"Conductor workspaces" naming the shim and the four entry points. VERSION 1.39.1.0 → 1.39.2.0 with full release-summary CHANGELOG entry.Test Coverage
Tests: 387 → 391 (+4 new). Full free suite: 718 pass, 0 fail.
Pre-Landing Review
No issues found. Code surface is tiny: 14 lines of TS in the shim (fully unit-tested), 4 single-line import additions, doc updates. Heavy Codex pass skipped — the 209-line diff is mostly markdown.
Design Review
No frontend files changed — skipped.
Eval Results
No prompt-related files changed — evals skipped.
TODOS
No TODO items completed in this PR (no existing entries match this scope).
Documentation
This PR includes its own documentation as part of the planned release:
USING_GBRAIN_WITH_GSTACK.md— new "What you get after setup", "Path 4 (remote MCP / split-engine)", "/sync-gbrain workflow", "Conductor + GSTACK_* env vars" sections + env vars table extensions + two troubleshooting entries (silent embedding failure, FILE_TOO_LARGE watermark).CONTRIBUTING.md— "Conductor workspaces" section gained a paragraph on the GSTACK_* prefix pattern, the shim file, and the four entry points already wired up.Coverage map (Diataxis):
lib/conductor-env-shim.ts: reference ✅ CHANGELOG + CONTRIBUTING + USING_GBRAIN, how-to ✅ Conductor section + contributor checklist, explanation ✅ why-prefix rationale in both docs./sync-gbrainworkflow: reference ✅, how-to ✅ stage breakdown +--skip-failed, explanation ✅ pre-flight gating rationale.Test plan
bun test test/skill-validation.test.ts test/gen-skill-docs.test.ts test/conductor-env-shim.test.ts— 718 pass, 0 fail/sync-gbrainran clean in this Conductor workspace with onlyGSTACK_OPENAI_API_KEYin env — 3294 chunks embedded,gbrain searchreturned ranked code regions at 0.95 top score🤖 Generated with Claude Code