Skip to content

feat(integration): a chat sent to another model starts a new conversation; the server page tests rows, warns while open and confirms a start - #250

Merged
hiyouga merged 2 commits into
devfrom
fix/playground-server-ux
Oct 9, 2026
Merged

hiyouga merged 2 commits into
devfrom
fix/playground-server-ux

Conversation

@hiyouga

@hiyouga hiyouga commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Four playground fixes the owner asked for before 0.5.2.

  1. Chat: sending to another model starts a new conversation.
    • Before: the backend silently started an empty history whenever the client options changed, while the page kept showing the earlier messages as one continuous chat.
    • Now: sending to another entry (a different model id, client type or base URL) calls /api/clear, starts a new session, and draws a divider: "New conversation with <model> · the messages above are not sent".
    • Composer hint: it says this before Enter is pressed. Picking another model and back before sending changes nothing.
    • Key or extra-header edits: the conversation continues. /api/chat now carries a session's history over when it rebuilds the client, so no history resets silently.
  2. Server page: Test / Test all for model rows, sent straight to the upstream through POST /server/api/test.
    • Input: {"model": row}, the row as typed. $VAR cells are read from the playground's environment.
    • Output: "Passed" with first token, total, tokens out (thinking + response) and TPS, or "Failed" with the upstream's message.
    • Limits: three rows at a time, 60 s each.
    • First token: the first event that carries an item. Anthropic reports usage in a stop event at message_start, before any token, so the first event alone would undercount the wait.
  3. Open-server banner: while the running server has no keys, the top of the page says anyone who can reach its URL can use the models, with an Add a key button.
  4. Start / Apply confirmation:
    • Dialog contents: a native <dialog> showing the listen URL, the model count and the keys the saved file holds, plus the open-server warning when there are none.
    • Keyboard: Enter confirms, Escape cancels, and Ctrl/Cmd+S does nothing while it is open.
    • Why Apply confirms too: it replaces the running server, so it can change the URL or drop the keys.
    • Stop: doesn't ask.

The site docs (server, tracing) and an unreleased changelog entry are included.

Decisions

  • Owner: "new conversation", not carrying history across models or keeping a thread per model.
  • Owner: the test goes straight to the upstream, not through the running server.
  • Earlier messages stay visible above the divider: comparing models on one prompt is what the playground is for.
  • Key or extra-header edits continue the conversation: fixing a wrong key mid-chat shouldn't wipe it.

Test plan (vps4)

  • Python: 649 passed, 15 skipped. ruff check and ruff format --check clean.
  • TS: 637 passed. eslint, tsc --noEmit, prettier and build clean.
  • Server page against the stub in headless Chrome: 420 checks, 0 FAIL.
    • Covers the dialog (contents, Escape, focus trap, Enter confirms once), the banner (shows while open, hides after a key is applied) and Test / Test all (disabled until model id + key, Passed / Failed text, a result is dropped when the row is edited).
    • The palette checker's chroma-floor lines on the unchanged neutral greys are not page checks.
  • Live, both playgrounds (Python 25761, TS 25762), with real DeepSeek:
    • Server checks: 104 / 103 ok, 0 FAIL.
    • /server/api/test: ok: true with ~300 TPS. An unset $NOPE gives the unset-variable message, sk-bad gives the vendor's 401, and client_type: nope gives the unknown-client message.
    • The banner appears exactly when the console prints Open server:.
  • Chat switch check on both playgrounds:
    • Switching the client type posts /api/clear with the old session, draws one divider, and the reply no longer knows the earlier word.
    • A key-only edit keeps the session, and the model still recalls the word from after the switch.

🤖 Generated with Claude Code

…tion; the server page tests rows, warns while open and confirms a start

- Chat page: a message sent to another entry (model id, client type, base URL) clears the old session and starts a new one under a divider; the composer hint says so before Enter. A key or extra-headers edit continues the conversation: /api/chat carries a session's history over when it rebuilds the client.
- Server page: POST /server/api/test sends one short prompt straight to a row's upstream (the row as typed, $VAR read from the playground's environment) and reports the first token, total, tokens out and TPS, or the upstream's error; Test on a row and Test all, three at a time.
- Server page: a banner while the running server has no keys, and a dialog before Start and Apply naming the listen URL, the models and the keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hiyouga
hiyouga merged commit a218515 into dev Oct 9, 2026
4 of 5 checks passed
@hiyouga
hiyouga deleted the fix/playground-server-ux branch October 9, 2026 21:35
hiyouga added a commit that referenced this pull request Oct 9, 2026
Folds `changelog/unreleased/` into `changelog/0.5.2/` (#247 MMSP server
and `mmsp` client, #248 `google-official`, #249 Claude Haiku 5.5, #250
playground fixes), adds the 0.5.2 line to `CHANGELOG.md` /
`CHANGELOG.zh.md`, and versions `mmsp` and `@prismshadow/mmsp` 0.5.2.

Verified on vps4: Python 649 passed, 15 skipped; TS 637 passed; build
clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@hiyouga hiyouga mentioned this pull request Oct 9, 2026
hiyouga added a commit that referenced this pull request Oct 9, 2026
dev → main for 0.5.2:
- An MMSP server and the `mmsp` client (#247).
- `google-official` as the official Gemini client's name (#248).
- Claude Haiku 5.5 (#249).
- Playground fixes (#250).
- The fold (#251).

The entries are in `changelog/0.5.2/`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants