Repository navigation
test(e2e): add the afterModel continuation fixture - #1617
Conversation
Resolving that interrupt starts another model turn. The aimock fixture only matched the first turn, so the continuation returned 404 and the interrupt stayed open.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe middleware test fixture now includes a second entry for the same user message. The entry matches ChangesMiddleware test fixture
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other Merge Risk: ⚪ Minimal · up to This adds the expected second response for the generic afterModel scenario without matching the other parameterized scenarios. No concrete merge-blocking risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit b8502b5
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-acp
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-bedrock
@tanstack/ai-byteplus
@tanstack/ai-claude-code
@tanstack/ai-client
@tanstack/ai-cloudflare
@tanstack/ai-code-mode
@tanstack/ai-code-mode-snippets
@tanstack/ai-codex
@tanstack/ai-cohere
@tanstack/ai-compaction
@tanstack/ai-devtools-core
@tanstack/ai-durable-stream
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-grok-build
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-daytona
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-isolate-quickjs-bun
@tanstack/ai-llmgateway
@tanstack/ai-lovable
@tanstack/ai-mcp
@tanstack/ai-memory
@tanstack/ai-mistral
@tanstack/ai-octane
@tanstack/ai-ollama
@tanstack/ai-ollaya
@tanstack/ai-openai
@tanstack/ai-opencode
@tanstack/ai-openrouter
@tanstack/ai-perplexity
@tanstack/ai-persistence
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-reactor
@tanstack/ai-remix
@tanstack/ai-sandbox
@tanstack/ai-sandbox-blaxel
@tanstack/ai-sandbox-boxd
@tanstack/ai-sandbox-cloudflare
@tanstack/ai-sandbox-daytona
@tanstack/ai-sandbox-docker
@tanstack/ai-sandbox-e2b
@tanstack/ai-sandbox-local-process
@tanstack/ai-sandbox-sprites
@tanstack/ai-sandbox-upstash-box
@tanstack/ai-sandbox-vercel
@tanstack/ai-skills
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-typesafe
@tanstack/ai-utils
@tanstack/ai-vercel-gateway
@tanstack/ai-vertex
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/ai-worldlabs
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
@tanstack/svelte-ai-devtools
commit: |
The test
resolves a typed generic interrupt at afterModelstays open after the test resolves the review. The resume starts a second model call. The aimock fixture matches onlysequenceIndex0. The second call returns404 No fixture matched. This PR adds asequenceIndex1 fixture with the same content,AFTER_MODEL_CONTENT.🎯 Changes
The generic afterModel interrupt resume calls the model a second time.
testing/e2e/fixtures/middleware-test/generic-after-model.jsonhad no fixture for that call. The new entry uses the same user message and the same response text. No published package changes, so there is no changeset. The change is not user-facing, sodocs/stays as it is.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Root cause
Issue. The e2e test
resolves a typed generic interrupt at afterModelfails. The interrupt count stays at 1 after resolve. The input is the generic afterModel scenario with a resolved review.Cause.
onInterruptResolutionreturnscontinuefor this scenario. The chat loop then calls the model again.generic-after-model.jsonmatches onlysequenceIndex0. aimock returns 404 for the next call.Fix. This PR adds a
sequenceIndex1 fixture with the same text. The second call matches. The test can finish.Possible alternatives
toolResumeiscontinue. The before-tools fixture already has that second call. A skip in product code changes the agent loop. This PR does not do that.turnIndex.turnIndexcounts assistant messages. It does not use the server sequence counter.X-Test-Idalready gives this test its own sequence. The two calls are sequence 0 and sequence 1. This PR keepssequenceIndex.Testing
Commands run. I ran one agent-written aimock command on clean main
7216c7b58and on this branchb8502b5f2. Main exited 1. This branch exited 0. I did not runpnpm test:pr. I did not run Playwright. Vite in the earlier worktree failed to resolve@tanstack/ai, so the browser suite did not start.The command loads
generic-after-model.jsoninto aimock and sends twoPOST /v1/chat/completionsrequests. Both requests use the user message[generic-after-model] run test. Both responses must be status 200 and containAFTER_MODEL_CONTENT. Then the command exits 0.Clean main:
This branch:
A Playwright trace for this test showed the same 404 on the resume call.
Manual test.
testing/e2e/fixtures/middleware-test/generic-after-model.json.POST /v1/chat/completionsrequests with the user message[generic-after-model] run test.no_fixture_match.AFTER_MODEL_CONTENT.How this PR makes testing easy. The new fixture entry is on the branch. CI runs
tests/generic-middleware-interrupts.spec.ts.Risk / rollback
Risk is low. The new entry matches only the second call for this user message. Revert this PR to remove it.
Summary by CodeRabbit