whoami resolves from the nearest projection instead of the session's own bundle, so a native shadow session reports the wrong seat or none #283

Open
opened 2026-08-15 15:18:54 +00:00 by coilyco-ops · 0 comments
Member

Why this matters now

agent-compose whoami is documented as "print what this session calls itself, for a SessionStart hook". It is the designated successor to the legacy aos <harness>-<os>-<hostname>-<tag>-<pronouns> self-name that coilyco-flight-deck/agentic-os#1043 retires.

It cannot take that job yet. Measured on agent-compose v2.22.0, whoami returns a different answer per --target, and the default target returns nothing.

Measured

One live Claude Code session. AGENT_COMPOSE_LAUNCH=1, AOS_NATIVE_SESSION=yw56, CLAUDE_CODE_SESSION_ID=44ddd5dd-49b7-42db-9d9d-444447b72bba. The composed instructions in this session assign the director role, seat Darren (he).

  • --target = cwd, the session's primary working directory /private/var/.../T/aos/native/yw56/projects - empty output, exit 0
  • --target /tmp/aos/native/yw56/home/.claude, the session's own composed home - Angie [she] yw56, which is the engineer seat
  • --target /Users/kai/projects/coilyco-flight-deck/agentic-os, the canonical checkout - solar director [he] yw56
  • the session's own composed identity card - Darren (he)

Four answers, one session. The default is the empty one, because --target defaults to . and a native session shadow is not a projected workspace.

Root cause

whoami resolves by nearest projection walking up from --target. That is a filesystem-path proxy for session identity, and the proxy breaks in two ordinary cases:

  • Native session shadow. The agent's cwd is a per-session temporary tree with no projection above it, so the lookup finds nothing.
  • Concurrent roles on one host. The nearest projection is host-wide state, not session state. ~/.agent-compose/projection.json currently points at bundle bba64af0c5c1f081, while the newest bundle da98d272a72766b7 carries "role": "design" and seat Delphi. Neither is this session's director seat.

No session-to-bundle binding is recorded anywhere on disk. grep -rIl "44ddd5dd\|yw56" ~/.agent-compose/ returns nothing. whoami does emit the yw56 short ID from #279, so the session is known at render time. The seat name is simply not resolved from it.

What should change

whoami should resolve the seat from the launch bundle bound to the calling session. agent-compose already creates that bundle in launch, so the binding is the missing artifact rather than missing information. --target stays useful for inspecting a projection deliberately, but it should not be how a session learns its own name.

Acceptance

  • A session launched through agent-compose launch <role> <harness> reports that role's seat from whoami regardless of cwd or --target.
  • Two concurrent sessions on one host holding different roles each report their own seat.
  • whoami's answer matches the seat named in that session's own composed identity card, always.
  • Outside any compose session whoami stays silent, exit 0 with empty output, preserving the self-suppress contract the statusline provider depends on.
  • coilyco-flight-deck/agentic-os#1043 - retires the legacy aos name in favor of acompose. Blocked by this. Repointing the aos SessionStart hook today would replace a wrong-but-stable name with an empty banner.
  • coilyco-flight-deck/agentic-os#1037 - adds the acompose agent name to git commit attribution. Same correctness dependency: attribution must name the seat that actually did the work.
  • #279 - landed the phonetic short ID that whoami already renders.
## Why this matters now `agent-compose whoami` is documented as "print what this session calls itself, for a SessionStart hook". It is the designated successor to the legacy aos `<harness>-<os>-<hostname>-<tag>-<pronouns>` self-name that `coilyco-flight-deck/agentic-os#1043` retires. **It cannot take that job yet.** Measured on agent-compose v2.22.0, whoami returns a different answer per `--target`, and the default target returns nothing. ## Measured One live Claude Code session. `AGENT_COMPOSE_LAUNCH=1`, `AOS_NATIVE_SESSION=yw56`, `CLAUDE_CODE_SESSION_ID=44ddd5dd-49b7-42db-9d9d-444447b72bba`. The composed instructions in this session assign the **director** role, seat **Darren (he)**. * `--target` = cwd, the session's primary working directory `/private/var/.../T/aos/native/yw56/projects` - empty output, exit 0 * `--target /tmp/aos/native/yw56/home/.claude`, the session's own composed home - `Angie [she] yw56`, which is the **engineer** seat * `--target /Users/kai/projects/coilyco-flight-deck/agentic-os`, the canonical checkout - `solar director [he] yw56` * the session's own composed identity card - `Darren (he)` Four answers, one session. The default is the empty one, because `--target` defaults to `.` and a native session shadow is not a projected workspace. ## Root cause whoami resolves by nearest projection walking up from `--target`. That is a filesystem-path proxy for session identity, and the proxy breaks in two ordinary cases: * **Native session shadow.** The agent's cwd is a per-session temporary tree with no projection above it, so the lookup finds nothing. * **Concurrent roles on one host.** The nearest projection is host-wide state, not session state. `~/.agent-compose/projection.json` currently points at bundle `bba64af0c5c1f081`, while the newest bundle `da98d272a72766b7` carries `"role": "design"` and seat `Delphi`. Neither is this session's director seat. **No session-to-bundle binding is recorded anywhere on disk.** `grep -rIl "44ddd5dd\|yw56" ~/.agent-compose/` returns nothing. whoami does emit the `yw56` short ID from `#279`, so the session is known at render time. The seat name is simply not resolved from it. ## What should change whoami should resolve the seat from the launch bundle bound to the calling session. agent-compose already creates that bundle in `launch`, so the binding is the missing artifact rather than missing information. `--target` stays useful for inspecting a projection deliberately, but it should not be how a session learns its own name. ## Acceptance * A session launched through `agent-compose launch <role> <harness>` reports that role's seat from whoami regardless of cwd or `--target`. * Two concurrent sessions on one host holding different roles each report their own seat. * whoami's answer matches the seat named in that session's own composed identity card, always. * Outside any compose session whoami stays silent, exit 0 with empty output, preserving the self-suppress contract the statusline provider depends on. ## Related * `coilyco-flight-deck/agentic-os#1043` - retires the legacy aos name in favor of acompose. **Blocked by this.** Repointing the aos SessionStart hook today would replace a wrong-but-stable name with an empty banner. * `coilyco-flight-deck/agentic-os#1037` - adds the acompose agent name to git commit attribution. Same correctness dependency: attribution must name the seat that actually did the work. * `#279` - landed the phonetic short ID that whoami already renders.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/agent-compose#283
No description provided.