just stats: overview of the jobs in the journal #2

Merged
Levitating merged 2 commits from Claude/claude-forge:agent/issue-1 into master 2026-10-14 04:26:39 +02:00
Collaborator

Closes #1

  • just stats [journalctl selection] runs libexec/stats over the bot's journal entries (--since=-7d, REPO=… work as selections). It prints a line per job (start, thread, trigger, requester, outcome, turns, cost), then totals by trigger, outcome, repository and requester.
  • The journal didn't carry the trigger or outcome as fields, so Job now logs TRIGGER and ACTOR when it starts, and one finished entry with OUTCOME (pull_request, replied, silent, rejected, error) when it ends. Cost and turns come from the agent's existing COST_USD/TURNS fields. Older jobs show ?.
  • README: described under Logs.

Tested: ran libexec/stats on hand-made journal JSON and checked just --list. I could not run bundle exec rake here (gems are not installed in this environment), so the Job change is untested by the suite. The finished entry is an added info line, which the existing assertions shouldn't mind.

🤖 Generated with Claude Code

Closes #1 - `just stats [journalctl selection]` runs `libexec/stats` over the bot's journal entries (`--since=-7d`, `REPO=…` work as selections). It prints a line per job (start, thread, trigger, requester, outcome, turns, cost), then totals by trigger, outcome, repository and requester. - The journal didn't carry the trigger or outcome as fields, so `Job` now logs `TRIGGER` and `ACTOR` when it starts, and one `finished` entry with `OUTCOME` (`pull_request`, `replied`, `silent`, `rejected`, `error`) when it ends. Cost and turns come from the agent's existing `COST_USD`/`TURNS` fields. Older jobs show `?`. - README: described under Logs. Tested: ran `libexec/stats` on hand-made journal JSON and checked `just --list`. I could not run `bundle exec rake` here (gems are not installed in this environment), so the `Job` change is untested by the suite. The `finished` entry is an added `info` line, which the existing assertions shouldn't mind. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Jobs now log their trigger and requester when they start and their outcome
when they end, for libexec/stats to read together with the agent's cost.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner

@Claude rebase

@Claude rebase
Author
Collaborator

I didn't rebase. I merged master into agent/issue-1 instead, so the branch is now up to date with master.

I can't rebase here. Jobs like this one must add commits on top of the existing branch without rewriting history, and I can't force-push.

The merge was clean, with no conflicts. The only new master commit pulled in is 8ad37e4 ("dont restart agent"), which changes system/claude-forge-agent@.service.

If you want linear history, rebase locally with git rebase master and force-push. Alternatively, squash-merge the PR.

I didn't rebase. I merged `master` into `agent/issue-1` instead, so the branch is now up to date with master. I can't rebase here. Jobs like this one must add commits on top of the existing branch without rewriting history, and I can't force-push. The merge was clean, with no conflicts. The only new master commit pulled in is `8ad37e4` ("dont restart agent"), which changes `system/claude-forge-agent@.service`. If you want linear history, rebase locally with `git rebase master` and force-push. Alternatively, squash-merge the PR.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Levitating deleted branch agent/issue-1 2026-10-14 04:26:39 +02:00
Owner

@Claude please run sleep 120 and then reply "done"

@Claude please run sleep 120 and then reply "done"
Author
Collaborator

Something went wrong on my side (ClaudeForge::Workspace::GitError); the journal has the details under job Levitating-claude-forge-2-20261014T043428.997.

Something went wrong on my side (`ClaudeForge::Workspace::GitError`); the journal has the details under job `Levitating-claude-forge-2-20261014T043428.997`.
Owner

@Claude please run sleep 120 and then reply "done"

@Claude please run sleep 120 and then reply "done"
Author
Collaborator

Refusing to spawn agent, the reference refs/pull/2/head no longer exists.

Refusing to spawn agent, the reference `refs/pull/2/head` no longer exists.
Sign in to join this conversation.
No reviewers
No labels
claude
No milestone
No project
No assignees
2 participants
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
Levitating/claude-forge!2
No description provided.