Files
PaperClipAI/server
DottaandClaude Opus 5.5 3cd1370141 fix(github): re-read parked response requests after the settle decision changes (#22710)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Review agents answer GitHub pull requests, and a background sweep
settles each request's status comment once its run finishes
> - The sweep parks a request it cannot progress yet with a wait key,
and a broad rebuild skips it until that key changes
> - #22672 changed how requests settle, but requests parked by the older
code kept the same key after the deploy
> - So the new code never read them: 11 inline "Working on this…"
comments stayed open on staging after #22672 deployed
> - This pull request puts a decision version at the start of the wait
key
> - The benefit is that a deploy which changes the settle decision
re-reads every parked request once, so old stuck comments settle

## Linked Issues or Issue Description

Refs #22672

**Describe the bug**
After #22672 deployed to staging, 5 of 16 stuck inline "Working on
this…" review comments settled, but 11 did not. Their tasks had no new
activity, so their wait keys did not change, and the sweep kept skipping
them.

**Steps to reproduce**
1. A request is parked by the terminal response sweep with a wait key
from older code.
2. Deploy code that changes when such a request settles.
3. Nothing on the task changes, so the key stays the same and the
request is never read again.

**Expected behavior**
A deploy that changes the settle decision re-reads every parked request
once.

## What Changed

- `GITHUB_TERMINAL_RESPONSE_DECISION_VERSION` ("v2") now starts the
terminal sweep's wait key. Keys written before this change never match,
so each parked request is read once by the current decision.
- New test: requests parked with the old key, whose own run finished
before a newer run, are all settled after the sweep starts.

## Verification

- `reads requests parked by an older decision once after a deploy`: red
without the version (0 of 120 acknowledged), green with it (120 of 120).
- `server/src/services/chat-channels/github/` tests: 65 passed.
- After deploy: the 11 open "Working on this…" comments on
staging-reviewed PRs should settle within a sweep pass.

## Risks

- One extra read of every parked request right after deploy (one batched
page read per 100 rows, then they park again under the new key). Low
risk.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use and
code execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [ ] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:35:17 -06:00
..