Skip to content

fix(mention): use comment.updated_at so edit events report accurate queue delay - #595

Merged
max-sixty merged 1 commit into
mainfrom
hourly/review-26357588872
May 25, 2026
Merged

max-sixty merged 1 commit into
mainfrom
hourly/review-26357588872

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

For issue_comment.edited events, the tend-mention workflow's queue-delay computation in mention.yaml.j2:201 reads github.event.comment.created_at — the original post time, not the edit time. The "X seconds queued" prompt then reports elapsed-since-creation, which can be days or weeks when the trigger is an edit to a long-lived comment.

updated_at equals created_at for issue_comment.created events and reflects the edit time for issue_comment.edited, so one fallback ordering covers both cases. Same submitted_at / issue.updated_at fallbacks remain for pull_request_review and issues events. No behavior change for the bot's decision path — only the displayed delta becomes accurate.

Evidence

Observed this hour on max-sixty/worktrunk (run 26356819978):

  • tend-review-runs (run 26356566271) PATCHed its existing review-runs tracking comment (#2522 issuecomment-4496442260, created 2026-05-20, edited 2026-05-24T08:51:35Z).
  • The PATCH fired an issue_comment.edited event 2 seconds later, triggering tend-mention 26356819978.
  • The agent prompt opened with: "This job started 345461s after the triggering event (over ~40s means it was queued)." — 345,461 seconds ≈ 4 days, which is the comment's age, not the queue delay. Actual dispatch-to-start gap was a couple of seconds.

The agent still made the correct decision (silent exit via self-loop guard), so this is not a behavioral failure. It's a misleading number in the prompt that future agents could weight as "stale conversation" context.

Per review-reviewers evidence gist and last month's, issue_comment.edited events firing additional tend-mention runs is a documented-recurring shape (bot-self-PATCHes of tracking comments, conflict-resolution replies, daily review-runs appends, plus human-edit retriggers). Every one of those edit-triggered runs hits this same calculation.

Classification

  • Structural failure — comment.created_at deterministically returns the original post time for edited events, so every such event misreports its queue delay.
  • Gate 1 (Confidence): structural classification, 1 clear occurrence with multi-month historical pattern → meets bar.
  • Gate 2 (Magnitude): targeted one-line template fix → proportionate.

Scope (not changed)

This PR does not filter edited events, change concurrency keys, or add sender/commenter-based guards — those structural shapes were rejected in #154, #203, #212. The change is purely a prompt-accuracy fix.

Test plan

  • uv run pytest passes (3 regtest fixtures updated under --regtest-reset).
  • Reviewer confirms the comment.updated_at fallback chain is correct for the three event surfaces (issue_comment, pull_request_review, issues).

…ueue delay

For `issue_comment.edited` events, `comment.created_at` is the original
post time, not the edit time — so the queue-delta prompt reports
elapsed-since-creation rather than elapsed-since-event-dispatch.
`updated_at` equals `created_at` for `created` events and reflects the
edit time for `edited` events, so a single fallback ordering works for
both. The misleading large delta could nudge the agent toward
unnecessary conversation-drift caution; replacing it with the accurate
delta removes that noise without changing any decision path.
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label May 24, 2026
@max-sixty
max-sixty merged commit 14ae512 into main May 25, 2026
4 checks passed
@max-sixty
max-sixty deleted the hourly/review-26357588872 branch May 25, 2026 16:41
@max-sixty max-sixty mentioned this pull request May 27, 2026
max-sixty added a commit that referenced this pull request May 27, 2026
## Why

Cut the 0.1.2 release so consumer repos (and tend's own nightly regen)
pick up the new
`claude-interactive` harness and per-workflow `harness`/`model`
overrides.

## What's new since 0.1.1

**New `claude-interactive` harness**
(`max-sixty/tend/[email protected]`) — opt-in
alternative to the released `claude` harness. PTY-supervised interactive
`claude` via
`script(1)`, end-of-turn detected through Stop/StopFailure hooks. Built
as the
trial path ahead of Anthropic's June 15 billing split between Agent-SDK
metering and
the flat Claude Code subscription. Smoke tested end-to-end on tend
itself. PRs:
#609, #611, #613, #614, #615, #616.

**Per-workflow `harness` / `model` override** — adopters can flip a
single workflow
to a different harness or model without changing `.config/tend.yaml`
defaults. #612.

**Skill refinements** — nightly upstream-bot rebases (#605),
running-in-ci PR bar
(#604) and recheck (#573), env-filter loophole fix (#599),
authorAssociation warning
(#600), review-gates Gate 1 (#602).

**Bug fix** — mention queue-delay now uses `comment.updated_at` so edit
events report
accurately (#595).

## Compatibility

Released `claude` harness path is byte-identical; `claude-interactive`
is strictly
additive and opt-in. Consumer repos that don't touch `harness:` see no
change beyond
the new skill text and the mention-edit fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants