Auto-Devlogs

2 min read

Automated Pi session devlogs with detached workers

Summary

Created the auto-devlog Pi extension and standalone worker to export the active conversation branch on interactive quit and run the devlog skill in a separate headless Pi process. Replaced blocking shutdown execution with a detached supervisor that handled reports, a 180-second timeout with termination escalation, and temporary transcript cleanup. Added originating session_id to the transcript and worker prompt, and updated the skill to forward that provenance and correct its CLI documentation link. Smoke tests passed for extension loading, shutdown filtering, transcript handoff, worker options, cleanup, and re-entry protection. A detached-worker test returned from shutdown in 3 ms while a mock worker ran for 1.2 seconds; a separate test confirmed original-session-ID propagation. These tests used mocks and did not create real journal entries or verify CLI persistence of session_id; the bundled CLI documentation at the time warned that unknown fields could be ignored.

Decisions

  • Launched a detached supervisor on quit rather than waiting for model execution, so the terminal could become reusable promptly.
  • Passed session context through a private temporary JSON transcript and disabled extensions in the headless worker to prevent recursive logging.
  • Used the originating coding-session ID rather than the background worker’s ID for provenance.

Learnings

  • The active conversation branch provided the transcript handoff; no in-memory session context was shared with the worker.
  • Passing session_id in CLI JSON did not establish that older CLI versions persisted it.