Repository navigation
Conversation
OpenCode sessions only reach the journal when `ingest` runs the staging adapter, and a day summarized while it is still in progress cannot otherwise be refreshed. Both point at wanting one unattended run per day, just after the day is genuinely over. Adds a script, a launchd plist template and setup notes under contrib/. Nothing in src/ changes; this is packaging for a workflow the CLI already supports. Two details that are easy to get wrong and are handled here: - Sessions are selected by *logical* date, reading day_start_hour from config. Selecting on the calendar date both picks projects whose work belongs to the previous day and misses projects whose work belongs to this one. - The job runs at 05:05 rather than midnight. With day_start_hour at 5 a logical day is not over until 05:00, so a midnight run would summarize a day with five hours still to go — and freeze it that way. Secrets stay out of the plist: the script sources the shell environment, so a key named by summary_provider.api_key_env is never copied into a file launchd reads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Packaging for a workflow the CLI already supports. Nothing in
src/changes — this adds a script, a launchd plist template and setup notes undercontrib/.Why
Two things push toward one unattended run per day:
ingestruns the staging adapter, so they lag until someone runs it.Running once, just after the day is genuinely over, addresses both.
Depends on
--dateregenerating an existing entry; without it the nightly run is a no-op on any day that was already summarizedBranched from
mainand touches no shared files, so it can merge in any order relative to those — it simply does nothing useful until both land.Two details that are easy to get wrong
Sessions are selected by logical date, reading
day_start_hourfrom config, because that is howsummarizegroups them. Selecting on the calendar date is wrong in both directions: it picks projects whose work belongs to the previous day, and misses projects whose work belongs to this one. I hit exactly this while testing — a project with sessions at 00:07 and 01:48 was selected for the wrong day and summarized nothing.The job runs at 05:05, not midnight. With
day_start_hourat 5 a logical day runs 05:00 to 05:00, so a midnight run summarizes a day with five hours still left in it — and, because the entry then exists, freezes it that way.Scope
Entries are keyed by
(date, project), so a project used with both OpenCode and Claude Code on the same day yields one entry covering both. The script selects projects that had OpenCode activity; summarizing OpenCode sessions in isolation would need source-aware grouping in the tool itself. The README says so plainly rather than implying a cleaner separation than exists.Secrets stay out of the plist — the script sources the shell environment, so a key named by
summary_provider.api_key_envis never copied into a file launchd reads.Testing
Run end-to-end on macOS against a live corpus: a populated day (regenerating entries across five projects, with trivial ones correctly skipped), an empty day (clean no-op exit), and under
env -iwith a strippedPATHto mimic launchd's minimal environment rather than a login shell. Thelaunchctlregistration and recorded calendar interval were verified after install.🤖 Generated with Claude Code