backends: isolate the missing-credential fixture from ambient inference credentials
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 64/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bun, typescript
- Domain
- testing
Research direction
Start in packages/ui-backend-claude/tests/autonomous-envelope.test.ts around lines 87-91, where the an API profile without a credential refuses case runs with an empty profile environment. Then read turnEnv in packages/ui-backend-claude/src/sdk-options.ts and envSnapshot in packages/ui-backend-claude/src/config/env.ts, which merge the host environment. Reproduce by running the named bun run test command with and without a fictional ANTHROPIC_API_KEY. Done means the test passes in both environments, restores the prior variable state, and fails when the isolation is removed.
Written by the indexing model from the issue text.
Description
Out of scope
Changing production credential precedence, handling real credentials, external inference, changing #1993's browser fixture, or weakening the missing-credential refusal assertion.
Context
Found during #1993's bounded ordered-prefix control at checkout ee8aa00e4b1cd3e255e4e905153a4d4f55c33f27. The only preceding-file failure is autonomous Claude envelope > an API profile without a credential refuses before a relay or worker exists.
The test (test("an API profile, packages/ui-backend-claude/tests/autonomous-envelope.test.ts:87-91) supplies an empty profile environment but does not isolate ambient inference credentials. turnEnv merges a filtered host snapshot before the profile environment (turnEnv, packages/ui-backend-claude/src/sdk-options.ts:65-70); envSnapshot reads the host environment (envSnapshot, packages/ui-backend-claude/src/config/env.ts:182-190).
A focused controlled invocation with inherited Anthropic credential variables removed passes (one test). The same invocation with only the fictional ANTHROPIC_API_KEY=sk-odysseus-fixture added fails because the function returns rather than throwing at line 89. Both runs use the repository test wrapper and offline preload. No inference request or worker launch is required.
Scope
Make the missing-credential fixture own its credential environment, saving and restoring every variable it changes. Keep production behavior unchanged.
Acceptance criteria
- The original refusal and absence-of-relay assertions pass when the invoking process has no inference credential and when it contains a fictional API key or bearer-token sentinel.
- The fixture restores the exact preceding variable presence/value after success and failure; no real credential is printed.
- A mutation removing the fixture's isolation makes the named case fail for the original missing-refusal assertion with a fictional sentinel.
Verification
Use bun run test ./packages/ui-backend-claude/tests/autonomous-envelope.test.ts -t 'an API profile without a credential refuses' under both controlled environments, plus appropriate local preflight and affected hosted proof. Do not use real credentials or network calls.
Contract impact
None. Test environment isolation only. Unscheduled follow-up found while investigating #1993; this issue does not establish any relationship to the Playwright GUID failure.
2026-10-16 triage at main 45908608df63b07ee3d10d84ac608d132aa21caa: verified the missing-credential test and live host-environment merge/snapshot anchors against source. The retained fictional-sentinel comparison supplies the concrete failure class; triage did not run a new credential or inference control. Priority p2 reflects wanted, unscheduled test isolation. Scope, exclusions, acceptance, verification and no-contract-impact brief are complete, with no remaining design/decision/access/reproduction prerequisite; add agent-ready. Preserve exact environment presence/value through all paths and keep real credentials unobserved.
Keep standalone by reference to #736’s deterministic host-isolation outcome: that epic already has 100 direct native children, so no new attachment or reparenting is attempted. The public autonomous-Queue epic’s wider delivery is not a prerequisite for this independent fixture correction.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 947
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from schlessera/brain-kit
-
area: backends type: docs
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
schlessera/brain-kit#2383 ·
Maintainers usually reply within 1 day
-
agent-ready area: ci area: docs priority: p2 type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
schlessera/brain-kit#2104 · 4 comments ·
Maintainers usually reply within 1 day
-
agent-ready area: docs priority: p2 type: docs
Difficulty 1/5 Under an hour Newbie friendliness 88/100
schlessera/brain-kit#1990 · 3 comments ·
Maintainers usually reply within 1 day
-
agent-ready area: core type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
schlessera/brain-kit#1944 ·
Maintainers usually reply within 1 day
-
agent-ready area: render priority: p2 type: fix
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
schlessera/brain-kit#1828 · 1 comment ·
Maintainers usually reply within 1 day
All issues in schlessera/brain-kit
Similar issues
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Openarea: backend documentation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
snapotter-hq/SnapOtter#2919 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
obsidianmd/pele#39 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
biomejs/biome#12475 · 1 comment ·
Maintainers usually reply within 1 day