test(native-chat): make the image-replay case guard the branch it names

The frame carried `isReplay: true`, so the gate short-circuited and
`claudeUserFrameText` never ran - the content branch the test exists for was
uncovered. Verified by mutation: making claudeUserFrameText return null when no
part carries text (exactly the regression the comment warns about) left the
test green.

Drop the marker so the frame takes the fallback, and give this one case a 5s ack
budget: it does real file I/O before the timer starts, so 100ms could expire
under parallel load before the frame arrives.

The same mutation now fails the test.

Found by the review loop on #15657.
This commit is contained in:
Brennan Benson
2026-08-20 17:50:14 -07:00
parent 341ea87dce
commit 61adf0878e
@@ -230,13 +230,17 @@ describe('Claude structured dispatch image limits', () => {
const path = join(directory, 'shot.png')
await writeFile(path, Buffer.alloc(64))
const session = sessionFor()
// Real file I/O runs before the ack timer starts, so give this one room:
// a 100ms budget can expire under parallel load before the frame arrives.
const dispatched = dispatchClaudeTurn(
session,
{ clientMessageId: 'client-1', body: userMessage([{ type: 'image-ref', path }]) },
100
5_000
)
await vi.waitFor(() => expect(session.dispatchWaiters).toHaveLength(1))
// Deliberately UNSTAMPED: `isReplay` would short-circuit the gate and leave
// the content branch this test exists for untested.
resolveClaudeReplayWaiter(session, {
type: 'user',
message: {
@@ -247,8 +251,7 @@ describe('Claude structured dispatch image limits', () => {
},
parent_tool_use_id: null,
session_id: 'provider-session',
uuid: 'image-replay-uuid',
isReplay: true
uuid: 'image-replay-uuid'
})
await expect(dispatched).resolves.toMatchObject({