feat(fleet): export MOSAIC_AGENT_CLASS into agent env (A3a) #663

Merged
jason.woltje merged 2 commits from feat/a3a-agent-class-env into main 2026-06-24 17:20:00 +00:00
Owner

North Star A3a

Export the agent's class into its pane environment so the launcher can load the right persona.

What

generateAgentEnv (packages/mosaic/src/commands/fleet.ts) now emits a MOSAIC_AGENT_CLASS=${shellEnvValue(agent.className)} line directly after MOSAIC_AGENT_NAME. Defaults to worker (the roster parser default). The companion goal A3b will read this env var to inject the matching persona contract.

Merge semantics

mergeAgentEnv keys preserved/regenerated lines by VAR= name, so on re-launch the regenerated MOSAIC_AGENT_CLASS overrides the existing one — no duplicate lines, no stale class. Verified with a new merge test.

Tests

  • Updated the deterministic EnvironmentFile test to assert MOSAIC_AGENT_CLASS=implementer (non-default class).
  • Added a default test (class omitted → MOSAIC_AGENT_CLASS=worker).
  • Added a shell-escaping/verbatim test (orchestrator).
  • Added a merge test proving re-launch updates (single line) rather than duplicates.

Gates

  • build (deps): FULL TURBO, 12/12 ok
  • vitest: 597 passed (183 in fleet.spec.ts)
  • typecheck: clean
  • lint: clean
  • prettier: clean

Do NOT merge — review only.

## North Star A3a Export the agent's class into its pane environment so the launcher can load the right persona. ### What `generateAgentEnv` (packages/mosaic/src/commands/fleet.ts) now emits a `MOSAIC_AGENT_CLASS=${shellEnvValue(agent.className)}` line directly after `MOSAIC_AGENT_NAME`. Defaults to `worker` (the roster parser default). The companion goal A3b will read this env var to inject the matching persona contract. ### Merge semantics `mergeAgentEnv` keys preserved/regenerated lines by `VAR=` name, so on re-launch the regenerated `MOSAIC_AGENT_CLASS` overrides the existing one — no duplicate lines, no stale class. Verified with a new merge test. ### Tests - Updated the deterministic EnvironmentFile test to assert `MOSAIC_AGENT_CLASS=implementer` (non-default class). - Added a default test (`class` omitted → `MOSAIC_AGENT_CLASS=worker`). - Added a shell-escaping/verbatim test (`orchestrator`). - Added a merge test proving re-launch updates (single line) rather than duplicates. ### Gates - build (deps): FULL TURBO, 12/12 ok - vitest: 597 passed (183 in fleet.spec.ts) - typecheck: clean - lint: clean - prettier: clean Do NOT merge — review only.
jason.woltje added 1 commit 2026-06-24 16:47:33 +00:00
feat(fleet): export MOSAIC_AGENT_CLASS into agent pane env (A3a)
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline was successful
65ab835150
generateAgentEnv now emits MOSAIC_AGENT_CLASS (shell-escaped, right after
MOSAIC_AGENT_NAME) so a launching agent knows its class and the companion
A3b goal can inject the matching persona contract. Defaults to `worker`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jason.woltje added 1 commit 2026-06-24 17:07:22 +00:00
chore: re-trigger CI (push/ci infra flake on prior SHA)
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
7170aa1114
jason.woltje merged commit 0d17a29ebe into main 2026-06-24 17:20:00 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#663