Skip to content

Replay the real model's recorded answers with npm run dev:replay - #44

Merged
TechNomadCode merged 1 commit into
mainfrom
feat/replay-real-answers
Oct 21, 2026
Merged

TechNomadCode merged 1 commit into
mainfrom
feat/replay-real-answers

Conversation

@TechNomadCode

Copy link
Copy Markdown
Owner

Slice 22: watch the interface with the real model's answers, for free and without the token.

  • npm run dev:replay runs the dev server with the chat on 18 recorded baseline answers (3 per measured request), each reply whole after its recorded duration. Any other message gets the scripted fake, paced the same way. The header says "Replaying recorded answers".
  • npm run replays:copy trims a measurement's records into src/server/ai/replays.json: each call's parts and duration only, with no request bodies, headers, Cloudflare ids or logs.
  • The environment guard allows AI_CHAT_PROVIDER=replay; AI_PROVIDER stays "fake".
  • End-to-end: a second server on port 3101 replays at 100× speed for tests/e2e/replay.spec.ts only. Every other test stays on the scripted fake.

src/server files changed: adds ai/replay-chat-model.ts, ai/replays.ts and ai/replays.json; ai/providers.ts and env.ts take the replay adapter and REPLAY_SPEED; ai/fake-chat-model.ts exports lastVisitorMessage. Nothing the real model receives changes.

Checks: verify (509 unit tests), test:e2e (68), verify:secrets, all local.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechNomadCode
TechNomadCode merged commit 6e1dae5 into main Oct 21, 2026
5 checks passed
@TechNomadCode
TechNomadCode deleted the feat/replay-real-answers branch October 21, 2026 17:45
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.

1 participant