Generic per-provider host config: -provider-bin/-provider-config maps replace claude-named config fields #78
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
internal/configcarries claude-named host config:ClaudeBin/ClaudeConfigfields,-claude/-claude-configflags,LAB_CLAUDE_CONFIGenv. Each new provider (#2 Codex, Gemini) would copy the pattern, growing config.go per provider and permanently violating the grep-clean-core spirit of #2's acceptance.Decided in provider-seam grill (2026-07-09): one generic per-provider map surface; provider N+1 needs zero config.go changes.
Design
internal/config:-provider-bin id=pathand-provider-config id=path, stored asmap[string]stringkeyed by registered provider id.LAB_PROVIDER_BIN_<ID>/LAB_PROVIDER_CONFIG_<ID>(id uppercased, dashes to underscores:claude-code→CLAUDE_CODE).mainhands each adapter its entries at construction; adapters keep their own defaults (PATH lookup for bin,~/.claude.json-style default for config) when no entry exists.-claude,-claude-config,LAB_CLAUDE_CONFIGbecome documented deprecated aliases that write into the map'sclaude-codeentries. Precedence: the explicit generic form wins over an alias; document it. The alias shim is the only provider-named remnant in config.go, marked deprecated.Acceptance
-helpdocuments the generic flags; boot validation (existing pick/env precedence rules) applies to the map forms.Landing audit — PR #83 (
afk/78) → VERDICT: PASSfeat(config): …is Conventional Commits-clean; body carries a validCloses #78.origin/main(no conflicts). Branch was behind main; the merge pulls in unrelated changes with no overlap in the files this PR touches.config.gois provider-name-free except the single markedaliasProviderIDshim. ✓main.godegraded-boot guardhome=="" && ProviderConfig[claude-code]==""is semantically equivalent to the oldClaudeConfig==""(HOME unset ∧ nothing supplied), including the HOME-unset-but-explicit-config edge — no regression. ✓claudecode.Newdrops the two required-field checks and fills adapter-owned defaults (claudeon PATH;LoginDir/.claude.json);LoginDiris still validated, so the join is safe. ✓-helpdocuments the generic flags with the aliases marked deprecated (pinned byTestUsageDocumentsGenericProviderFlags). ✓nix/module.nixexample updated to the generic--provider-bin claude-code=…form. ✓ci.yml) gates the merge at forge level; the hermeticci-nix.ymlalso triggers here (PR touchesnix/module.nix). The lab token cannot read the combined status API, so I re-ran the Go gate locally on the merged tree:go build,go test,go vet, andgofmt -lall clean forinternal/config,internal/provider/claudecode,cmd/lab(claudecode tests run against real git/tmux/prlimit).0034-generic-per-provider-host-config.mdhere +0034-per-provider-login-sessions.mdlanded on main after this PR was authored). The repo already tolerates duplicate ADR numbers (two0033-*exist on main), so this is doc-hygiene only, not a blocker.No blockers. Awaiting free-text merge confirmation.