Add proxy handoff for exhausted sequences#20
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “proxy” end mode for sequence mocks so that once all sequence steps have been served, subsequent matching requests are not resolved by the mock and instead fall through to the configured backend target. This extends existing sequence end behaviors (loop/stay/reset) and updates the frontend to accurately display the new passthrough behavior.
Changes:
- Extend sequence
on_endto support"proxy"and implement backend passthrough when exhausted. - Update frontend sequence cursor/display logic, sidebar badges/tooltips, and editor controls to expose “proxy after end”.
- Add a focused Go test verifying first-step resolution and subsequent passthrough for proxy sequences.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mock.go | Implements on_end: "proxy" behavior in MatchAndResolve and updates sequence end-mode handling. |
| mock_test.go | Adds backend test ensuring exhausted proxy sequences fall through (return nil). |
| frontend/src/types.ts | Extends Sequence.on_end union to include 'proxy'. |
| frontend/src/sequence.ts | Keeps cursor/label logic aligned with backend behavior and adds proxy “next call” display. |
| frontend/src/components/Sidebar.tsx | Updates sidebar status tooltip and sequence fallback-status explanation for proxy mode. |
| frontend/src/components/MockEditorModal.tsx | Adds “Proxy after end” option and editor status text for exhausted proxy sequences. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+202
to
+206
| // On proxy mode, once we've exhausted all steps, stop resolving this mock | ||
| // so the request can fall through to the real backend target. | ||
| if seq.OnEnd == "proxy" && cur >= n { | ||
| return nil | ||
| } |
Dustec
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proxysequence end mode so exhausted sequences fall through to the configured backend targetWhy
Sequence mode already supports looping, staying on the last step, or returning the static fallback body. This change adds the missing passthrough behavior needed for flows where only the first N calls should be mocked and all subsequent calls should hit the real backend.
Implementation details
Sequence.OnEndwithproxyMatchAndResolvereturnnilonce aproxysequence is exhausted so the request can be proxied normallyValidation
go test ./...npm run build