Skip to content

feat: add Pi ready marker and session metadata#129

Closed
RogerNavelsaker wants to merge 6 commits intojayminwest:mainfrom
RogerNavelsaker:rn/pi-ready-marker
Closed

feat: add Pi ready marker and session metadata#129
RogerNavelsaker wants to merge 6 commits intojayminwest:mainfrom
RogerNavelsaker:rn/pi-ready-marker

Conversation

@RogerNavelsaker
Copy link
Copy Markdown
Contributor

Summary

  • pass explicit Overstory session metadata into Pi-managed sessions
  • switch Pi readiness detection to the explicit ✓ os-eco agent=... runtime=pi marker emitted by the companion extension
  • remove legacy core-generated Pi guard files and rely on the external os-eco Pi extension for session-scoped policy

Testing

  • bun test src/runtimes/pi.test.ts src/commands/sling.test.ts src/commands/coordinator.test.ts

Copy link
Copy Markdown
Owner

@jayminwest jayminwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Good DRY refactor centralizing session env vars, and the Pi ready marker is a clear improvement over fragile TUI heuristic detection. A few issues to address:

Must fix

  1. Supervisor sessionKind is wrong (src/commands/supervisor.ts) — The supervisor gets sessionKind: "coordinator" but it's a per-project supervisor, not a coordinator. The OverstorySessionKind union includes "standalone" | "orchestrator" | "coordinator" | "monitor" | "worker" but omits "supervisor". Either add "supervisor" to the union or use a more semantically accurate kind. This propagates an incorrect OVERSTORY_SESSION_KIND=coordinator env var to any consumer.

  2. No tests for buildOverstorySessionEnv() (src/agents/session-env.ts) — This is a new pure function with conditional spread logic. It should have a colocated session-env.test.ts covering: (a) all required fields are set, (b) optional taskId/profile are omitted when undefined and included when defined, (c) baseEnv merge order (Overstory keys should override baseEnv on collision). Trivially testable pure function — should be straightforward.

  3. Types belong in src/types.ts per project convention — CLAUDE.md states "All shared types and interfaces go in src/types.ts". The OverstorySessionKind type and OverstorySessionEnvOpts interface are cross-cutting (used by coordinator, monitor, supervisor, sling) and should be moved there.

Non-blocking suggestions

  • Document that OVERSTORY_SESSION_KIND, OVERSTORY_CAPABILITY, and OVERSTORY_PROJECT_ROOT are part of the external contract with the os-eco Pi extension (no consumers in the overstory codebase yet).
  • The PI_READY_MARKER_PREFIX uses a Unicode checkmark (\u2713) — consider a comment noting the exact character for searchability.
  • sapling.ts:48 comment "Mirrors the constant in pi-guards.ts" — the cross-reference was removed but no replacement context was added.

@RogerNavelsaker
Copy link
Copy Markdown
Contributor Author

Rebased onto current main and force-pushed. This branch now supersedes #112 for the Pi startup/readiness line of work: it carries the newer explicit ready-marker + session-env contract, the supervisor session-kind fix, direct tests for buildOverstorySessionEnv(), and the follow-up docs/comments requested in review.

@RogerNavelsaker
Copy link
Copy Markdown
Contributor Author

RogerNavelsaker commented Mar 23, 2026

Hi @jayminwest,

as I’ve been working on this, I realized it might be cleaner to keep the os-eco related tools together. I originally created the pi-os-eco extension as a way to contribute while keeping the Overstory code separate from the direct pi-coding-agent.

​If you're interested, I’m happy to transfer the pi-os-eco repository to you. This would allow you to publish the extension to NPM under your own organization and keep the entire ecosystem under one roof. Let me know if that’s something you’d like to do.

… vars

- Add optional extensionSource field to PiRuntimeConfig so the extension
  URL is not hardcoded to a personal repo — callers can override via config
- Document OVERSTORY_* agent session env vars in CLAUDE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@RogerNavelsaker RogerNavelsaker deleted the rn/pi-ready-marker branch March 29, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants