Skip to content

Add proxy handoff for exhausted sequences#20

Merged
andrespaez90 merged 2 commits into
mainfrom
codex/sequence-proxy-after-end
May 14, 2026
Merged

Add proxy handoff for exhausted sequences#20
andrespaez90 merged 2 commits into
mainfrom
codex/sequence-proxy-after-end

Conversation

@andrespaez90

Copy link
Copy Markdown

Summary

  • add a new proxy sequence end mode so exhausted sequences fall through to the configured backend target
  • update the mock editor and sequence badges to expose and explain the new behavior in the UI
  • add backend coverage for the exhausted-sequence handoff case

Why

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

  • extend Sequence.OnEnd with proxy
  • make MatchAndResolve return nil once a proxy sequence is exhausted so the request can be proxied normally
  • keep the frontend cursor logic aligned with backend behavior so the sidebar and editor correctly show when the next request will go to the real backend
  • add a focused Go test covering the first mocked response and subsequent passthrough

Validation

  • go test ./...
  • npm run build

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_end to 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 thread mock.go
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
}
@andrespaez90 andrespaez90 merged commit ae94b4a into main May 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants