fix(pr-daemon): rate-limit hints; price the gpt-5.6 models #21

Merged
naps62-yolo merged 2 commits from week-review/2026-W35 into main 2026-08-28 19:40:50 +01:00
Owner

Two carry-over items from the 2026-W35 review.

#18 pr-daemon hint debounce. Hints are now banked per PR and role until one actually goes out, so a busy pane or a cooldown delays a hint but never loses it — the old code advanced the snapshot on the same tick that diffed it, so a held reason could never be recomputed. After a hint the next waits hintCooldownSeconds (default 300) and carries every reason accumulated meanwhile. A payload identical to the last one is dropped, and a ci hint to a land session is dropped when that session's own worktree already holds the head commit.

Evidence from the week: PR #369's land session took 20+ hints, #412 about 20, #411 twelve in five hours; one PR earlier in the month got five byte-identical reason=comments lines with the same updated= stamp.

#19 model pricing. Unpriced models counted as zero, so every codex row read as free. The gpt-5.6-sol row reproduces a pi-reported total to the cent, which also confirms the 0.1 cache-read multiplier applies to OpenAI. GLM-4.7-Flash has no published per-token rate and stays out.

With the rates in, codex gpt-5.6-sol turns out to cost about ten times terra per worker session while pushing back four times as often. That is a routing question, not a code change; filed separately.

Two carry-over items from the 2026-W35 review. **#18 pr-daemon hint debounce.** Hints are now banked per PR and role until one actually goes out, so a busy pane or a cooldown delays a hint but never loses it — the old code advanced the snapshot on the same tick that diffed it, so a held reason could never be recomputed. After a hint the next waits `hintCooldownSeconds` (default 300) and carries every reason accumulated meanwhile. A payload identical to the last one is dropped, and a `ci` hint to a `land` session is dropped when that session's own worktree already holds the head commit. Evidence from the week: PR #369's land session took 20+ hints, #412 about 20, #411 twelve in five hours; one PR earlier in the month got five byte-identical `reason=comments` lines with the same `updated=` stamp. **#19 model pricing.** Unpriced models counted as zero, so every codex row read as free. The `gpt-5.6-sol` row reproduces a pi-reported total to the cent, which also confirms the 0.1 cache-read multiplier applies to OpenAI. GLM-4.7-Flash has no published per-token rate and stays out. With the rates in, codex `gpt-5.6-sol` turns out to cost about ten times `terra` per worker session while pushing back four times as often. That is a routing question, not a code change; filed separately.
naps62-yolo added 2 commits 2026-08-28 17:19:08 +01:00
Every hint costs the receiving session a full model turn. The daemon sent
one per forge event with no quiet period, so a busy PR produced 20+ in a
day and sometimes repeated a payload verbatim.

Reasons are now banked per PR and role until a hint actually goes out, so
a busy pane or a cooldown delays one but never loses it. After a hint,
the next waits hintCooldownSeconds (default 300) and carries everything
that accumulated. A payload identical to the last is dropped, as is a ci
hint to a land session whose worktree already holds that head commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
feat(week-review): price the gpt-5.6, Kimi and GLM models
ci / nix (pull_request) Successful in 9s
ci / lint (pull_request) Failing after 14s
ab48785254
Unpriced models counted as zero, so every codex row read as free and the
tool comparison was wrong. Rates are the providers' published ones; the
sol row reproduces a pi-reported total to the cent, which also confirms
the 0.1 cache-read multiplier applies to OpenAI.

GLM-4.7-Flash has no published per-token rate and stays out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
naps62-yolo merged commit d1a198ab8b into main 2026-08-28 19:40:50 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/agent-skills#21