mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 06:03:51 +01:00
## Thinking Path > - Paperclip coordinates AI agents and human decisions. > - Native runs report blockers through the completion feedback service. > - A run could name a human owner and stop without saving a question. > - The task then had only a generic blocker card and no answerable choice. > - This change requires a saved request receipt before accepting that blocker. > - The human can answer the request, and the existing continuation flow can resume the work. ## Linked Issues or Issue Description **What happened?** A native run could report a human-owned product decision blocker with no saved question, approval, or decision. The task stopped after publishing the choices only as text. **Expected behavior** The agent must save an answerable request that requires a human response and resumes the task after that response. **Steps to reproduce** 1. Start a native task. 2. Call `paperclip_block` with a human owner, a concrete choice in `unblockAction`, and no request receipt. 3. Before this change, the report was accepted and no answerable request existed. After this change, the agent receives a correction and must save the request first. **Paperclip version or commit** Reproduced against `845ca8506a2a` with an isolated source checkout and embedded PostgreSQL. **Deployment mode** Source tests on macOS arm64 with Node 25.6.1 and pnpm 9.15.4. No hosted deployment was made. Related: #22674 improves the text on generic blocker cards. #20807 changes blocker routing. This change enforces the saved request contract before a native worker can stop. ## What Changed - Require a cited, current human-only interaction with `wake_assignee`, a linked pending approval, or an open decision with `wake_origin_agent`. - Check company, task, creator, recipient, request state, and continuation policy. Reuse active requests from prior runs. Reject historical, dismissed, resolved, expired, and unrelated records. - Give the agent a correction in the same turn when it reports a text-only handoff. Add the request and receipt rules to native task instructions. - Expose `request_human_input` in the closed Muse first-party catalog. It uses the existing task, run, and authorizer checks. Generic API and repository operations stay outside that catalog. - Cover the original failure, request reuse, saved answers and queued response delivery, invalid request states, and approval and decision compatibility. ## Verification - Reproduced the original bug with a failing regression, then confirmed the same test passes after the fix. - Passed 114 tests across `native-human-blocker-feedback`, `native-completion-feedback`, `native-completion-format-feedback`, and `native-execution-input`. The review-fix run passed all 161 tests across these suites and `historical-task-questions`. - Passed the updated 16-test request suite after adding the saved-answer delivery check. - Passed `pnpm --filter @paperclipai/server typecheck` across all server layers. - Passed test-budget validation, `git diff --check`, and the secret/PII scan. - `pnpm verify --explain` selected 2,013 of 2,373 Vitest files. Focused local checks cover this change; required CI must supply broad typecheck, test, build, and runner coverage on the final revision. - Initial verification exposed two TypeScript errors and three tests that expected the old permissive behavior. The type errors and expectations were corrected before the passing runs above. - [The first CI run](https://github.com/paperclipai/paperclip/actions/runs/47462198570/job/145490417452) found two more historical-question tests that expected a human blocker with no saved request to be accepted. Their expectations now match the enforced contract; they still check that historical questions stay answerable and do not gate completion. - Reproduced the Muse review finding with a failing native-profile test. After the catalog fix, all 10 selected Muse tests pass, including the new request test and existing actor, grant, and lock-wait authority checks. - Final revision `7d4928cebe5`: [CI passed](https://github.com/paperclipai/paperclip/actions/runs/47463165222) with 68 successful checks and 6 expected skips. [Greptile scored 5/5](https://github.com/paperclipai/paperclip/pull/23820#issuecomment-7429462031) on this revision. No unresolved review threads remain. GitHub reports a clean, mergeable branch. ## Risks - This tightens native human-owned blocker reports. An older in-flight prompt may receive a correction and must save or cite a request before stopping. - Persisted shapes and identities do not change. Existing questions, approvals, decisions, sessions, and saved results carry forward. No migration is required. - Already committed text-only blockers are not backfilled. They need a new agent turn to create the missing request. - Response delivery is tested through its durable queue. No live provider run or hosted deployment was tested. ## Model Used OpenAI Codex, `gpt-6.1-sol`, with xhigh reasoning effort 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 - [x] All Paperclip CI gates are green - [x] 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>