Repository navigation
Description
The law
The e2e lane reads credentials the way the product does. CLAUDE.md's Tests section: the tmux TUI suite "SKIPS rather than fails with no key", and #184 is the warning that a lane which skips for its own reasons is unit-green and e2e-broken until somebody notices.
What happens
internal/e2e/harness_test.go:84-86 (newWorld):
if strings.TrimSpace(os.Getenv("OPENROUTER_API_KEY")) == "" {
t.Skip("no OPENROUTER_API_KEY: this lane drives a real model")
}The product resolves a key three ways, in internal/config/apikey.go:52 (func APIKeyAt): OPENROUTER_API_KEY, then OPENAI_API_KEY, then PersistedAPIKey(profileDir), the api_key stored in the profile's config.json. config.Load refuses with ErrNoAPIKey only when all three are empty (config.go:361).
So on a machine whose ~/.aforge/config.json holds a usable key and whose shell exports nothing, every aforge door works and the whole tagged e2e lane skips green. newWorld even copies the person's profile into the throwaway home three lines later (personConfig(), harness_test.go:89-97), so the binary under test would have found the key; the skip fires first, on the one road of three.
Found by af-dev-4b in the #568 lane: the lane reported green with the key on disk and unexercised.
Replication a stranger can run
- Put a key in the profile only:
aforgewith the key set once through the product (or write{"api_key": "sk-..."}to$AFORGE_HOME/config.json), andunset OPENROUTER_API_KEY OPENAI_API_KEY. make buildthengo test -tags e2e -run TestTUIE2E -count=1 -timeout 40m -v ./internal/e2e/.- Observed:
--- SKIP ... no OPENROUTER_API_KEY: this lane drives a real modelfor the whole lane. Expected: the lane runs, becausebin/aforgeitself would. - Control:
bin/aforgestarts and answers with the same environment.
Fix shape
newWorld decides "is there a key" with the product's own resolver (the function at apikey.go:52, given the person's profile dir it already locates via personConfig()), and skips only when that returns empty. The skip message names all three roads. No new env var, no test-only key path.
Queued for after the WIP freeze; do not start without the coordinator.
Drafted with CodeAF · reviewed and owned by the author
Activity
e2e: gate the live lanes on the product's own key resolution (#576)
e2e: close the remaining skip paths around liveKey (#576)
e2e: resolve the live profile key through InheritedDir (#576)
fix(#576): e2e live-key gate uses product key resolution (#824)
start page: a waiting permission no longer makes ctrl+t a dead key
start page: a waiting permission no longer makes ctrl+t a dead key
start page: a waiting permission no longer makes ctrl+t a dead key
start page: a waiting permission no longer makes ctrl+t a dead key
Questions: one frame, one chooser, one key grammar — and the amber on…
tests: the prefix gate weighs the belt a configured machine actually …
auxiliary inventory: every request says what it is for, a dead role g…
exec: a job's shell cannot reach the tmux server hosting codeaf
exec: a job's shell cannot reach the tmux server hosting codeaf (#1166)
delegate, seniordev: the model's commands get the chat's scrubbed she…
tests: the prefix gate weighs the belt a configured machine actually …