Context
Iris now has a local macOS user (iris) and the host run-as proof works. sessions already supports caller-owned sessions with target-owned payloads via sessions wake --os-user <user> / $SHIMMER_OS_USER (see KnickKnackLabs/sessions#73).
shimmer agent is still split:
- headless:
sessions new + sessions wake
- interactive: direct harness exec (
pi by default)
That direct harness path means shimmer bypasses the session boundary and cannot use the new OS-user payload routing for normal interactive agent wakes.
Desired behavior
shimmer agent should always go through sessions, including interactive sessions. For dedicated OS-user agents, the default should be caller-owned session, target-owned payload:
sessions new ... # runs as caller
sessions wake ... --os-user iris # payload runs as iris
Do not default to:
run-as-user --user iris -- sessions new ...
run-as-user --user iris -- sessions wake ...
That would make the session physically agent-owned; we may support that later as an explicit mode, but it is not the Iris first-wake default.
Proposed shimmer changes
shimmer as <agent>:
- default: require same-name OS user to exist and be in
agents; export SHIMMER_OS_USER=<agent>
- explicit override for legacy/shared-user agents, candidate flag:
--shared-os-user
- clear
SHIMMER_OS_USER / related metadata before setting a new identity
shimmer agent:
- remove direct interactive harness exec path
- always create/resume a
sessions session and wake it
- pass
--os-user "$SHIMMER_OS_USER" to sessions wake when set (or deliberately rely on sessions reading the env, but explicit argv may be clearer)
- dedicated OS-user cwd:
/Users/<os-user>/home if it exists, else /Users/<os-user>
- shared-user override cwd: preserve caller cwd
Why caller-owned session by default
The caller initiated the session, so the caller owns the session record. The wake event should record which agent / OS user was active for that span. A later design can support explicit agent-owned sessions or session association transfer if needed.
Validation
- Tests cover interactive
shimmer agent using sessions, not direct harness.
- Tests cover
shimmer as erroring when dedicated OS user is missing/not in agents unless --shared-os-user is passed.
- Tests cover
shimmer agent passing --os-user to sessions wake in dedicated mode.
- Existing headless behavior remains green.
Related
Context
Iris now has a local macOS user (
iris) and the host run-as proof works.sessionsalready supports caller-owned sessions with target-owned payloads viasessions wake --os-user <user>/$SHIMMER_OS_USER(see KnickKnackLabs/sessions#73).shimmer agentis still split:sessions new+sessions wakepiby default)That direct harness path means shimmer bypasses the session boundary and cannot use the new OS-user payload routing for normal interactive agent wakes.
Desired behavior
shimmer agentshould always go throughsessions, including interactive sessions. For dedicated OS-user agents, the default should be caller-owned session, target-owned payload:Do not default to:
That would make the session physically agent-owned; we may support that later as an explicit mode, but it is not the Iris first-wake default.
Proposed shimmer changes
shimmer as <agent>:agents; exportSHIMMER_OS_USER=<agent>--shared-os-userSHIMMER_OS_USER/ related metadata before setting a new identityshimmer agent:sessionssession and wake it--os-user "$SHIMMER_OS_USER"tosessions wakewhen set (or deliberately rely on sessions reading the env, but explicit argv may be clearer)/Users/<os-user>/homeif it exists, else/Users/<os-user>Why caller-owned session by default
The caller initiated the session, so the caller owns the session record. The wake event should record which agent / OS user was active for that span. A later design can support explicit agent-owned sessions or session association transfer if needed.
Validation
shimmer agentusingsessions, not direct harness.shimmer aserroring when dedicated OS user is missing/not inagentsunless--shared-os-useris passed.shimmer agentpassing--os-usertosessions wakein dedicated mode.Related
notes/iris-os-user-session-environment.md