Files
PaperClipAI/tests
DottaandPaperclip 8fe5d5defc fix(evals): honor the shared feedback read deadline (#18026)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Product E2E evaluations must retain feedback from each paid attempt.
> - The collector reads saved feedback and native tool events before
teardown.
> - A five-second request limit can stop a valid read before the shared
read deadline.
> - This pull request gives event reads the remaining shared read
budget.
> - The total deadline and reserved checkpoint time stay the same.

## Linked Issues or Issue Description

**What happened?**

A paid Ask attempt passed the product grade but retained partial
feedback invocation coverage. The collector recorded
`events_read_failed`. Its event endpoint later returned HTTP 200. The
retained timing is consistent with a request that exceeded the
five-second request limit. This change fixes that deterministic failure
path; it does not prove the cause of every historical partial read.

**Expected behavior**

A valid read that takes eight seconds can complete within the 30-second
collection deadline. A stalled read must still time out and leave time
to save the available feedback. No read or paid attempt is retried.

**Steps to reproduce**

1. Return a terminal native run and an empty saved-feedback list.
2. Make the event read take eight seconds and respect the supplied
request timeout.
3. Run `collectAttemptFeedback` with a 30-second deadline.
4. Before this fix, the read times out after five seconds and invocation
coverage stays partial.

Related accounting and reporting work: Refs #18010.

## What Changed

- Use the remaining shared read budget for event API requests. Keep the
five-second cap for other reads.
- Add regressions for an eight-second event response, a stalled event
response that preserves saved feedback, and a stalled early feedback
read that still permits the event scan.
- Document the read budget, reserved persistence time, and no-retry
behavior.

## Verification

- Red: the initial two regression tests fail before the fix. The other
42 feedback tests pass. The early-read starvation review regression then
fails against the first implementation (44 pass), and passes after
narrowing the change.
- Green: 58 tests pass across feedback collection, interrupted recovery,
process shutdown, and scheduled finalization.
- Full Product support run: 4,609 pass, three skip, and the retained
embedded PostgreSQL bootstrap test fails on this host. The log remains
available. This is not a full local pass.
- Local Product typecheck fails on installed workspace export mismatches
outside the changed files. Hosted CI must check the exact commit with
clean dependencies. No local full repository build pass is claimed.
- Original paid grades, partial feedback receipts, and accounting
journals remain unchanged. This repair makes zero provider calls.

## Risks

- A stalled event read can consume the remaining read budget. Other
endpoints keep their five-second cap. The shared deadline still reserves
up to five seconds for the final checkpoint.
- A slow event page can leave later runs uninspected. Those runs remain
partial or unavailable. The change does not treat missing evidence as
success.

## Model Used

- OpenAI Codex, GPT-6, with reasoning and code execution tools. The
exact serving variant and context window are not exposed in this
session.

## 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
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-10-28 09:33:47 -05:00
..