fix
This commit is contained in:
51
CHANGELOG.md
51
CHANGELOG.md
@@ -4,6 +4,57 @@ All notable changes to AI-RPG are documented here.
|
||||
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.5.0] — 2026-06-21
|
||||
|
||||
Major gameplay release: submit_plan logic, tool retry, production SSE mode, chat history, name bank editor.
|
||||
|
||||
### Backend — Critical: submit_plan & tool-call logic
|
||||
|
||||
- **submit_plan forbidden on first substep**: the terminal tool (submit_plan, submit_step) cannot be called on the first round of Phase 1. The model must do at least some work (call entity_*, env_update, etc.) first. If it tries, a system message is appended: "You called submit_plan without doing any work first."
|
||||
- **submit_plan cancelled if other tools failed**: if the model calls submit_plan in the same response as other tools that FAILED, the submit_plan is cancelled with a tool_result: "submit_plan cancelled because other tools in this response failed. Fix the errors first." The model must retry.
|
||||
- **Configurable tool retry**: new setting `llm.tool_retry_attempts` (default 3). When the model returns no tool calls, the loop retries with a system nudge: "You did not call any tools. You MUST use the available tools. If you tried to call a tool but it didn't work, try again with proper JSON arguments." Up to `tool_retry_attempts` retries before forcing the terminal tool.
|
||||
- **suggest_actions retry**: Phase 3 suggest_actions now retries up to `tool_retry_attempts` times with the same nudge pattern. If all retries fail, defaults to `["Continue exploring", "Talk to someone nearby"]`.
|
||||
- **submit_step retry**: Phase 2 writer now retries up to `tool_retry_attempts + 1` times.
|
||||
|
||||
### Backend — Critical: Production SSE mode
|
||||
|
||||
- **SseEmitter `debug` flag**: when `DEBUG=false` (production), the emitter transforms/filters events:
|
||||
- `tool_call` events → transformed into `status` events with friendly messages (e.g. "Added new entity", "Updated game state", "Updated story progress"). Failed tool calls, RAG queries, calculations, and submit_* calls are filtered out entirely.
|
||||
- `llm_call_start`/`llm_call_end` events → filtered out.
|
||||
- `phase_start` events → friendly names: `planning` (Phase 1), `writing` (Phase 2), `sending` (Phase 3).
|
||||
- All 4 SSE endpoints (builder, editor, iterate, intro streams) now pass `debug=get_settings().debug` to SseEmitter.
|
||||
|
||||
### Backend — New: Chat history endpoint
|
||||
|
||||
- **`GET /api/sessions/worlds/{id}/history?before={seq}&limit=20`** — returns full chat history with pagination. Used by the frontend for scroll-up loading. Returns `{steps: [...], has_more: boolean, oldest_sequence: number | null}`.
|
||||
|
||||
### Backend — New: Name bank admin endpoints
|
||||
|
||||
- `GET /api/admin/names/{language}` → `{language, names: [...], count}`
|
||||
- `PUT /api/admin/names/{language}` body `{names: [...]}` → replaces entire bank
|
||||
- `POST /api/admin/names/{language}/add` body `{name: "..."}` → adds one name
|
||||
- `DELETE /api/admin/names/{language}/{name}` → removes one name
|
||||
|
||||
### Backend — New setting
|
||||
|
||||
- `llm.tool_retry_attempts` (integer, default 3) — number of retries when the LLM returns no tool calls.
|
||||
|
||||
### Frontend — 17 files changed, 1 new
|
||||
|
||||
- **Chat history preservation**: intro_scene ALWAYS shown as first message. New steps APPENDED (not replacing). Scroll-up pagination via `GET /api/sessions/worlds/{id}/history`. "Loading more..." indicator. Scroll position preserved on prepend.
|
||||
- **Removed duplicate suggested actions**: the chips above the input field are gone. Suggested actions only appear under the last GM message.
|
||||
- **Selected action marking**: clicking a suggested action immediately shows it as a player message. The clicked action is highlighted; others are greyed out. Custom input also greys out all suggestions.
|
||||
- **Tool call bubble width fix**: `max-w-full overflow-hidden` on root, `truncate` on tool name, collapsible `<details>` with `overflow-auto` + `break-all` for args/result.
|
||||
- **Debug-only elements**: "Disconnected" indicator hidden entirely. SseStatus only shows for connecting/error states. Production mode shows friendly phase labels: "Reading...", "Planning...", "Writing...", "Processing...".
|
||||
- **Client-side time formatting**: new `formatGameTime(timeStr, language)` utility. Applied in WorldEditPage, WorldCard, PlayPage (computes `current_time_human` client-side since `GET /api/worlds/{id}` doesn't include it).
|
||||
- **Name bank editor**: new card in SettingsPanel between UI Settings and Text Replacements. Shows en/ru name lists with × remove buttons, add input, and Save button.
|
||||
- **No more large text flash**: WorldBuilder no longer renders intro_scene text before redirect. Redirect delay reduced from 800ms to 150ms.
|
||||
- **Localized builder step messages**: all step labels and messages now use i18n keys.
|
||||
|
||||
### Verification
|
||||
- Backend: 68 unit tests pass, 58 routes.
|
||||
- Frontend: `tsc --noEmit` → 0 errors. `npm run build` → success (405 KB JS / 26 KB CSS, ~122 KB gzipped).
|
||||
|
||||
## [1.4.0] — 2026-06-21
|
||||
|
||||
Major UX release: redirect to edit after world creation, environment panel, admin separate routes, collapsible settings, name bank, page titles.
|
||||
|
||||
Reference in New Issue
Block a user