Repository navigation
fix(cli): clear delivered image-only queue entries - #59
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 5/5
packages/cli/test/suite/agent-session-queue.test.tsadds an issue-specific regression test outside thetest/suite/regressions/<issue-number>-<short-slug>.test.tsconvention, which may reduce test discoverability and suite organization; move it to the documented regressions location.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/cli/test/suite/agent-session-queue.test.ts">
<violation number="1" location="packages/cli/test/suite/agent-session-queue.test.ts:387">
P3: This is a regression test for a specific bug (pi#8581), but the suite README directs issue-specific regression tests to `test/suite/regressions/<issue-number>-<short-slug>.test.ts`. Adding the image-only case to the characterization file instead diverges from that documented convention; consider moving it to a regression test file.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
| expect(harness.session.pendingMessageCount).toBe(0); | ||
| }); | ||
|
|
||
| it("removes an image-only steering message after delivery", async () => { |
There was a problem hiding this comment.
P3: This is a regression test for a specific bug (pi#8581), but the suite README directs issue-specific regression tests to test/suite/regressions/<issue-number>-<short-slug>.test.ts. Adding the image-only case to the characterization file instead diverges from that documented convention; consider moving it to a regression test file.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/cli/test/suite/agent-session-queue.test.ts, line 387:
<comment>This is a regression test for a specific bug (pi#8581), but the suite README directs issue-specific regression tests to `test/suite/regressions/<issue-number>-<short-slug>.test.ts`. Adding the image-only case to the characterization file instead diverges from that documented convention; consider moving it to a regression test file.</comment>
<file context>
@@ -384,6 +384,35 @@ describe("AgentSession queue characterization", () => {
expect(harness.session.pendingMessageCount).toBe(0);
});
+ it("removes an image-only steering message after delivery", async () => {
+ const waiting = await createWaitingHarness();
+ const { harness, waitForToolStart, promptPromise, releaseToolExecution } = waiting;
</file context>
The queue-removal branch in _handleAgentEvent was gated on the user message having text, so an image-only steer or follow-up — a pasted screenshot sent mid-turn — was never spliced out after delivery: pendingMessageCount stayed above zero and the entry lingered in the queue. The queues already store "" for such messages, so matching on the empty text like any other message is enough. Ported from upstream pi.
bd6d149 to
ec0f150
Compare
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
|
Addressed in bd6d149 — moved to |
Summary
When a queued user message starts,
_handleAgentEventremoves it from the steering / follow-up queue so the UI sees the right pending count. That whole block was wrapped inif (messageText), so a message carrying only images — a pasted screenshot steered mid-turn — never got removed after delivery.pendingMessageCountstayed stuck above zero and the entry sat in the queue.The queues already store
""for such messages, soindexOf("")matches correctly; the text guard was the only thing in the way. Removed it.Testing
test/suite/agent-session-queue.test.tssteers an image-only message mid-tool-call and asserts the image reaches the model, the agent queue drains, andpendingMessageCountreturns to 0.main(expected 1 to be +0) and passes with the fix.packages/cli:vitest --run test/suite/agent-session-queue.test.ts— 15 passed.bun run check-typesclean.