feat(headless-examples): adopt SYNADIA_* identity env vars#156
feat(headless-examples): adopt SYNADIA_* identity env vars#156M64GitHub wants to merge 2 commits into
Conversation
pi-headless and claude-code-headless register full 5-token controller identities (agents.*.pi-headless/cc-headless.<owner>.<name>) but used a bare per-example env prefix — a fifth naming family. They now follow the SYNADIA_* convention shared with agents/* (CLI flag stays highest): owner: --owner > SYNADIA_PI_HEADLESS_OWNER > SYNADIA_OWNER > PI_HEADLESS_OWNER (legacy) > $USER > "anon" name: --name > SYNADIA_PI_HEADLESS_NAME > SYNADIA_NAME > PI_HEADLESS_NAME (legacy) > config > "control" (claude-code-headless mirrors with SYNADIA_CLAUDE_CODE_HEADLESS_* / CLAUDE_CODE_HEADLESS_*; hyphens in the agent name map to underscores.) Legacy vars keep working. cc-headless's invalid-owner error now names the SYNADIA_* overrides. Verified: cc-headless tsc clean; pi-headless tsc shows the same single pre-existing error as unmodified main (type-only @earendil-works/pi-ai import in pi-session-manager.ts — module absent from the transitive install; untouched here). Live smoke on isolated NATS: controllers register agents.prompt.pi-headless.peragent.ctl1 and agents.prompt.cc-headless.peragent.ctl2 with per-agent vars beating fleet-wide and legacy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@claude - please review |
|
Claude finished @M64GitHub's task in 1m 17s —— View job PR Review: feat(headless-examples): adopt SYNADIA_* identity env vars
SummaryThe implementation is clean, correct, and consistent across both examples. The identity chain ( One minor oversight to address before merge: Finding: cc-headless name error message not updatedIn // Line 207 — owner error (updated ✓):
`...Override with --owner, SYNADIA_CLAUDE_CODE_HEADLESS_OWNER, or SYNADIA_OWNER.`
// Line 212 — name error (NOT updated ✗):
`...Override with --name or CLAUDE_CODE_HEADLESS_NAME.`A user hitting an invalid-name error would only be told about the legacy env var. For consistency this should read something like: `claude-code-headless: invalid name "${name}" — must match [a-z0-9_-]{1,63}. Override with --name, SYNADIA_CLAUDE_CODE_HEADLESS_NAME, or SYNADIA_NAME.`Everything else looks good
|
…errides The invalid-owner error was updated but the invalid-name one still named only the legacy var — symmetric fix per the #156 review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Fixed in the latest commit — the invalid-name error now lists 🤖 Generated with Claude Code |
Seventh PR in the identity env var series — covers the two published headless controller examples, which register full 5-token identities (
agents.*.pi-headless/cc-headless.<owner>.<name>) but used a bare per-example env prefix (a fifth naming family).What
claude-code-headless mirrors with
SYNADIA_CLAUDE_CODE_HEADLESS_*/ legacyCLAUDE_CODE_HEADLESS_*(hyphens → underscores per the convention settled in #154). Purely additive — legacy vars keep working. cc-headless's fail-fast invalid-owner error message now names theSYNADIA_*overrides. READMEs + CHANGELOGs updated.Note: env plumbing only — no SDK surface involved, so per the release ladder this does not depend on any npm publish.
Verification
tsc --noEmitclean; pi-headless shows the same single pre-existing error as unmodified main (type-only@earendil-works/pi-aiimport inpi-session-manager.ts, module absent from the transitive install — untouched by this PR, worth its own look).agents.prompt.pi-headless.peragent.ctl1andagents.prompt.cc-headless.peragent.ctl2— per-agent vars beating fleet-wide (SYNADIA_OWNER=fleet) and legacy (PI_HEADLESS_OWNER=legacy,PI_HEADLESS_NAME=old) exactly per the chain.🤖 Generated with Claude Code