mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-10-19 17:43:26 +00:00
## Summary
A story with no saved image mode was shown as **Text Only** in Story
Settings, but the turn pipeline read the same missing value as Agent
Mode (`?? 'agentic'` in `ActionInput`). So a story whose settings said
"No images will be generated" generated images on every turn, which
matches a report of a story "set to Text Only" still producing them.
The missing value is historical data. Stories created before the setting
existed carry none, stories created while the agentic mode was still
called `'auto'` carry a value that no reader recognises (generation
skipped it and Story Settings selected no option), and imports and syncs
carry either one unchanged. Every story either wizard creates today
stores one of the three current modes.
## Changes
- **The mode is checked once, when a story is read.** `mapStory` passes
settings through `readStorySettings` (`utils/storySettings.ts`), which
drops an `imageGenerationMode` that is not `'none'`, `'agentic'` or
`'inline'`, so the story reads as having no mode chosen.
`StorySettings.imageGenerationMode` is then true to its type for every
story in memory. Nothing is written back, so an older export or sync
payload is handled the same way whenever it arrives. Documented in
`persistence.md`.
- **Generation treats no mode as Text Only.** Readers that act on the
mode use `storyImageMode(settings)` (`?? 'none'`), replacing `??
'agentic'` in the pipeline. `ActionInput` reads it once per turn, and
the image step gets it from `ImagePhase` rather than re-reading the
store. The image context and both image phases take a required
`ImageGenerationMode`, so the phase's unreachable `!== 'agentic'` branch
and its skip reason are gone. `generateImagesForNarrative` returns early
for `'none'`, so the service enforces Text Only itself. The older inline
flag is not consulted. Background images keep their own switch.
- **Story Settings stops presenting a default as a choice.** With no
mode, `WritingStyleFields` selects no option and shows: "This story has
no image mode set, or its saved mode isn't recognized. It runs as Text
Only until you choose one." Choosing any option saves it and clears the
hint. The wizards always hold a valid mode and never show it. The option
list is built from `IMAGE_GENERATION_MODES`.
## Behaviour change
Stories with no saved mode that were silently getting automatic images
stop getting them, including stories from before the setting whose only
image field is the old inline flag. Their settings now say so, and
choosing Agent Mode or Inline Mode brings images back.
## Testing
- `utils/storySettings.test.ts`: each valid mode is kept; `'auto'`, an
unknown string, a non-string and `null` are dropped with the rest of the
settings intact; the old inline flag and `null` settings pass through.
`utils/image.test.ts` and `imageUtils.test.ts` cover the no-mode case,
and the slot-agreement tests pass `{ imageGenerationMode: 'agentic' }`
explicitly, since `{}` now means Text Only.
- `npm run check` (0 errors), `npm run lint` (0 errors), `npm test`
(1947 passed).
- Checked in the running app on the first commit, with an image profile
configured: stories with no mode and with `'auto'` show no selection and
the hint, generate no scene images, report the image step as skipped,
and offer no manual image action; choosing Agent Mode generates images
and shows it selected; choosing Text Only selects it and clears the
hint; both wizards show a selected mode and never the hint; a wizard
story created with Text Only stores `"none"`. The review restructure has
not been run in the app yet.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Stories with a missing or unrecognized image-generation setting now
run in Text Only mode until a valid mode is selected. The settings panel
shows no preselected option and explains that image generation is off.
* Image generation now consistently respects the story’s saved mode
across writing, streaming, and image requests. Background image
generation remains available even when standard image generation is off.
* Invalid saved image-generation values are ignored, while valid saved
modes are preserved.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| architecture | ||
| development | ||
| README.md | ||
Aventuras — internal documentation
How the app is put together and why it is put together that way. The user-facing page is the repository README; this is for whoever is changing the code.
These documents carry the reasoning that does not fit in a comment: the measured numbers, the failure a design exists to prevent, the two things that must stay in step. Code comments stay short and say only what the next reader cannot infer — see CLAUDE.md.
Architecture
| Document | Read it before touching |
|---|---|
| overview.md | the repository layout, StoryEntry/branches/chapters/world state, the generation pipeline, or the side panels and their swipe gestures |
| context-injection.md | services/ai/retrieval/, WorldStateInjector, the three tiers, stickiness, agentic or static memory retrieval |
| lore-management.md | services/ai/lorebook/, services/duplicates/, LoreManagementCoordinator, the duplicates window |
| prompts.md | anything under services/prompts/templates/, prompt packs, or the order blocks are assembled in |
| ai-services.md | adding a ServiceId, agent profiles, reasoning effort, or a default in ai/core/defaults.ts |
| persistence.md | SQLite, a new migration, src-tauri/src/, or the shape of the settings blob |
| dialogue-and-tts.md | utils/dialogue.ts, dialogue highlighting, or the TTS pipeline |
| story-time.md | services/storyTime/, time anchors, timeline anomalies, reconciliation, or a new story's starting time |
| exchange-format.md | services/exchange/, exporting or importing a vault character, scenario or lorebook, the Aventura JSON format |
Development
| Document | Read it before |
|---|---|
| testing.md | writing a test — the suite has real constraints on what it can import |
| release.md | cutting a release, or changing the updater, CI or the build scripts |
| ios-build-target.md | the iOS build target, the unsigned .ipa pipeline, or gen/apple |
Keeping them true
If a change alters behaviour a document describes, update the document in the same commit. A document nobody trusts costs more than no document: the numbers in these files were measured, and a stale one is read as a measurement.