Skip to content

Add image prompt instructions to connections - #4842

Merged
SpicyMarinara merged 9 commits into
Pasta-Devs:stagingfrom
snpNEXT:feat/capability-image-prompt-hints
Aug 10, 2026
Merged

Add image prompt instructions to connections#4842
SpicyMarinara merged 9 commits into
Pasta-Devs:stagingfrom
snpNEXT:feat/capability-image-prompt-hints

Conversation

@snpNEXT

@snpNEXT snpNEXT commented Aug 10, 2026

Copy link
Copy Markdown

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes N/A (No target issue in mind, will look and edit this if I find one)

Why this change

  • Allow image-generation connections to define provider-specific prompt instructions.
  • Apply those instructions through existing prompt-writing paths without sending the instruction block directly to image providers.

This allows any finnicky local model to basically work at all, as the default image prompt controls aren't local friendly, and provide limited control per connection. Personally, I found this feature to be a MUST HAVE, I've been using it on my local fork for months and months before finally deciding I really should be contributing back.

What changed

  • Added imagePromptInstructions to connection types, schemas, persistence, transfer, and the connection editor.
  • Added localized connection-editor copy.
  • Applied the instructions to selfie and Illustrator prompt generation.
  • Preserved the setting through gallery and agent retry generation paths.
  • Added a changelog entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue (Yeah I couldn't get the docker container to work even prior to my changes so I was unable to check this, not sure what I did wrong!!! sorry!)
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • pnpm check passed locally.
  • Selfie and roleplay image-generation flows were manually exercised.
  • Isolated runtime data was used to verify connections and encrypted API keys were preserved.
  • Asides from the minimal new addition to options (works on desktop and mobile), no UI changes were made.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

image

Summary by CodeRabbit

  • New Features

    • Added optional image-prompting instructions for image connections.
    • Users can configure, edit, save, duplicate, import, and export these instructions.
    • Instructions now support selfie, Illustrator, custom image-generation, and game asset workflows.
    • Added guidance text and an example placeholder.
  • Bug Fixes

    • Trimmed and limited instructions to 20,000 characters.
    • Restricted instructions to image-producing agents.
    • Preserved configured image connections and instructions during retries.
  • Documentation

    • Added an Unreleased changelog entry for image-prompting instructions.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 06e66010-794b-4c25-a5cd-063da95d9648

📥 Commits

Reviewing files that changed from the base of the PR and between 0c658a3 and 74260f5.

📒 Files selected for processing (1)
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

The change adds optional image-prompting instructions to image connections. The client stores and transfers the setting. Server routes apply it to selfie, Illustrator, game, and image-capable agent prompt-generation contexts.

Changes

Image prompting instructions

Layer / File(s) Summary
Connection configuration and persistence
CHANGELOG.md, packages/shared/src/..., packages/server/src/db/..., packages/server/src/services/storage/..., packages/client/src/components/connections/ConnectionEditor.tsx, packages/client/src/hooks/use-connections.ts, packages/client/src/lib/connection-transfer.ts, packages/client/src/localization/locales/en.json
Connections accept nullable imagePromptInstructions. The editor saves, exports, imports, and displays the setting for image providers. Storage preserves the value during creation, updates, and duplication. Shared validation limits instructions to 20,000 characters.
Selfie and Illustrator prompt flows
packages/server/src/routes/gallery.routes.ts, packages/server/src/services/generation/conversation-selfie-command-runtime.ts, packages/server/src/routes/generate/retry-agents-route.ts, packages/server/src/services/generation/illustrator-prompt-runtime.ts, packages/server/src/services/generation/illustrator-manual-prompt-generation.ts, packages/server/src/services/generation/image-prompt-instructions.ts
Selfie and Illustrator prompt generation resolves image-connection instructions and adds them to provider-facing prompt contexts.
Image-capable agent execution
packages/server/src/routes/generate.routes.ts, packages/server/src/services/agents/agent-pipeline.ts, packages/server/src/services/agents/agent-executor.ts, packages/server/src/routes/generate/retry-agents-route.ts
Image-capable agents receive per-agent image context and execute separately from regular batches. Agent messages append normalized instructions in a dedicated block.
Shared image instruction compaction
packages/server/src/routes/game.routes.ts, packages/server/src/services/game/game-asset-generation.ts, packages/server/src/services/sidecar/scene-analyzer.ts, packages/shared/src/schemas/scene-analysis.schema.ts
Game image-generation and scene-analysis paths use the shared image-instruction length limit and compaction behavior.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ConnectionEditor
  participant ConnectionStorage
  participant GenerateRoutes
  participant AgentPipeline
  participant AgentExecutor
  participant ImagePromptModel

  ConnectionEditor->>ConnectionStorage: Save imagePromptInstructions
  GenerateRoutes->>ConnectionStorage: Resolve selected or default image connection
  ConnectionStorage-->>GenerateRoutes: Return imagePromptInstructions
  GenerateRoutes->>AgentPipeline: Configure per-agent context resolver
  AgentPipeline->>AgentExecutor: Execute image-capable agent individually
  AgentExecutor->>ImagePromptModel: Send provider-facing image guidance
Loading

Possibly related PRs

Suggested reviewers: spicymarinara

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding image prompt instructions to connections.
Description check ✅ Passed The description follows the template, explains the change, lists validation, documents the uncompleted container check, and includes UI evidence.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@snpNEXT snpNEXT closed this Aug 10, 2026
@snpNEXT
snpNEXT deleted the feat/capability-image-prompt-hints branch August 10, 2026 05:40
@snpNEXT
snpNEXT restored the feat/capability-image-prompt-hints branch August 10, 2026 05:40
@snpNEXT snpNEXT reopened this Aug 10, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/server/src/routes/gallery.routes.ts (1)

1258-1292: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Extract the duplicated selfie system-prompt augmentation into a shared helper. Both sites build selfieSystemPromptWithImageInstructions from an identical template string that reads imagePromptInstructions off the image connection and wraps it in an <image_prompting_instructions> block. This is the same logic implemented twice, and it already has a third, differently-worded variant in agent-executor.ts.

  • packages/server/src/routes/gallery.routes.ts#L1258-L1261: replace the inline template string with a call to a shared helper, e.g. appendImagePromptInstructions(selfieSystemPrompt, imageConn.imagePromptInstructions).
  • packages/server/src/services/generation/conversation-selfie-command-runtime.ts#L204-L207: replace the identical inline template string with the same shared helper call.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/routes/gallery.routes.ts` around lines 1258 - 1292,
Extract the duplicated image-prompt augmentation into a shared
appendImagePromptInstructions helper, preserving the existing trimming and
<image_prompting_instructions> formatting. Replace the inline template in
packages/server/src/routes/gallery.routes.ts:1258-1292 and
packages/server/src/services/generation/conversation-selfie-command-runtime.ts:204-220
with calls passing the respective selfie system prompt and image connection
instructions; leave agent-executor.ts unchanged unless needed to host or reuse
the helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/client/src/components/connections/ConnectionEditor.tsx`:
- Line 724: Update the connection transfer/save path and import validation to
trim imagePromptInstructions and enforce a shared 5,000-character maximum before
persistence or prompt use, including all image-generation paths that read the
direct connection field. Keep the textarea maxLength as a secondary client-side
guard, and reuse one shared limit rather than duplicating literal values.

In `@packages/client/src/localization/locales/en.json`:
- Around line 4058-4060: Update the localization text for
ui.connections.connectioneditor.imagePromptingInstructionsHelp to describe that
the instructions are added to the existing prompt-writer system message and
processed by the configured Illustrator provider and model. Remove claims about
an extra call or default language model, while preserving that an invalid-JSON
retry may trigger a second call.

In `@packages/server/src/routes/generate/retry-agents-route.ts`:
- Around line 4192-4207: Scope _imagePromptInstructions to the image-generating
agent instead of assigning it once to shared agentContext memory. In the batched
retry prompt-executor flow, resolve each image_prompt result’s imageConnectionId
through the corresponding imagePromptAgent settings and load that connection’s
imagePromptInstructions before generating its prompt; ensure custom image agents
never inherit another agent’s instructions.

In `@packages/server/src/services/agents/agent-executor.ts`:
- Around line 2367-2381: Restrict image-prompt instructions to agents that
generate image prompts: in packages/server/src/services/agents/agent-executor.ts
lines 2367-2381, gate both the requiresTerminalUserInstruction contribution and
the <image_prompting_instructions> append in buildAgentMessages using the
appropriate illustrator/image-producing agent-type check. In
packages/server/src/routes/generate.routes.ts lines 3634-3647, only populate
agentContext.memory._imagePromptInstructions when an illustrator agent is
active; otherwise leave it unset, avoiding irrelevant instructions for tracker,
lorebook-keeper, quest, about-me-keeper, spotify, haptic, and custom agents.

---

Outside diff comments:
In `@packages/server/src/routes/gallery.routes.ts`:
- Around line 1258-1292: Extract the duplicated image-prompt augmentation into a
shared appendImagePromptInstructions helper, preserving the existing trimming
and <image_prompting_instructions> formatting. Replace the inline template in
packages/server/src/routes/gallery.routes.ts:1258-1292 and
packages/server/src/services/generation/conversation-selfie-command-runtime.ts:204-220
with calls passing the respective selfie system prompt and image connection
instructions; leave agent-executor.ts unchanged unless needed to host or reuse
the helper.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6d64012b-5b5d-4e36-9335-d5bf3b62e5a8

📥 Commits

Reviewing files that changed from the base of the PR and between 612d4d2 and ec8a8e3.

📒 Files selected for processing (16)
  • CHANGELOG.md
  • packages/client/src/components/connections/ConnectionEditor.tsx
  • packages/client/src/hooks/use-connections.ts
  • packages/client/src/lib/connection-transfer.ts
  • packages/client/src/localization/locales/en.json
  • packages/server/src/db/schema/connections.ts
  • packages/server/src/routes/gallery.routes.ts
  • packages/server/src/routes/generate.routes.ts
  • packages/server/src/routes/generate/retry-agents-route.ts
  • packages/server/src/services/agents/agent-executor.ts
  • packages/server/src/services/generation/conversation-selfie-command-runtime.ts
  • packages/server/src/services/generation/illustrator-manual-prompt-generation.ts
  • packages/server/src/services/generation/illustrator-prompt-runtime.ts
  • packages/server/src/services/storage/connections.storage.ts
  • packages/shared/src/schemas/connection.schema.ts
  • packages/shared/src/types/connection.ts

Comment thread packages/client/src/components/connections/ConnectionEditor.tsx Outdated
Comment thread packages/client/src/localization/locales/en.json
Comment thread packages/server/src/routes/generate/retry-agents-route.ts Outdated
Comment thread packages/server/src/services/agents/agent-executor.ts
@SpicyMarinara

Copy link
Copy Markdown
Collaborator

Thank you for the PR, @snpNEXT! Please check Coderabbitai's comments and resolve all issues for the PR. I also have a question about the Image prompt Instruction: why are you sending those in a separate call instead of adding them to the call that generates the image prompt itself?

@snpNEXT

snpNEXT commented Aug 10, 2026

Copy link
Copy Markdown
Author

Thank you for the PR, @snpNEXT! Please check Coderabbitai's comments and resolve all issues for the PR. I also have a question about the Image prompt Instruction: why are you sending those in a separate call instead of adding them to the call that generates the image prompt itself?

Working on addressing the reviews as we speak!
As for the seperate calls, well actually they are attached onto the existing calls, the language I chose which said up to an extra call was chosen poorly and I'm fixing that. For my noodle agents PR, it will be an extra call, as that has no extra call to hook into, but for everything else it's linked into, it will be using the existing LLM call.

@snpNEXT

snpNEXT commented Aug 10, 2026

Copy link
Copy Markdown
Author

Alright, I think I got them all, tested and everything works still. Unsure if I need to do anything to retrigger the bot review, never used it.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/server/src/routes/generate.routes.ts (1)

3635-3650: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Populate agentContext.memory._imagePromptInstructions for image-capable custom agents.

buildAgentMessages() enables image prompt instructions for config.type === "illustrator" or custom agents with trigger_image_generation, but this route only sets _imagePromptInstructions when a built-in illustrator agent is present. A custom image-capable agent with no illustrator type therefore gets the instruction flag without the shared context. Add the same image-prompt eligibility condition used by isImagePromptRetryAgent() or handle each image-capable agent separately before calling executeAgentBatch().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/routes/generate.routes.ts` around lines 3635 - 3650,
Update the image-prompt setup around the resolvedAgents check to include custom
agents whose configuration enables trigger_image_generation, matching the
eligibility condition used by isImagePromptRetryAgent() and
buildAgentMessages(). Populate agentContext.memory._imagePromptInstructions
using the existing connection-resolution flow before executeAgentBatch(), while
preserving the current built-in illustrator behavior.
♻️ Duplicate comments (1)
packages/client/src/localization/locales/en.json (1)

4059-4059: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the forward-looking Noodle claim from the current help text.

The sentence "Some flows, including Noodle, use an additional prompt-writing call to apply them" describes behavior that does not exist in this PR. Per the PR comment thread, the separate-call behavior applies only to a future noodle-agents PR, not to any code shipped here.

Update the text to describe only the current flows (selfie and Illustrator), and mention the Noodle behavior later, when that PR ships.

✏️ Proposed wording
-  "ui.connections.connectioneditor.imagePromptingInstructionsHelp": "When set, these instructions are added to the existing prompt-writer system message and processed by the configured Illustrator provider and model before the prompt is sent to this image backend. Some flows, including Noodle, use an additional prompt-writing call to apply them. Useful for tags, quality tokens, negative-prompt conventions, or local/ComfyUI syntax. An invalid-JSON retry may trigger another call.",
+  "ui.connections.connectioneditor.imagePromptingInstructionsHelp": "When set, these instructions are added to the existing prompt-writer system message and processed by the configured Illustrator provider and model before the prompt is sent to this image backend. Useful for tags, quality tokens, negative-prompt conventions, or local/ComfyUI syntax. An invalid-JSON retry may trigger another call.",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/client/src/localization/locales/en.json` at line 4059, Update the
localization value for
ui.connections.connectioneditor.imagePromptingInstructionsHelp to remove the
claim about Noodle and additional prompt-writing calls, and describe only the
currently supported selfie and Illustrator flows while preserving the rest of
the guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/server/src/routes/generate.routes.ts`:
- Around line 3635-3650: Update the image-prompt setup around the resolvedAgents
check to include custom agents whose configuration enables
trigger_image_generation, matching the eligibility condition used by
isImagePromptRetryAgent() and buildAgentMessages(). Populate
agentContext.memory._imagePromptInstructions using the existing
connection-resolution flow before executeAgentBatch(), while preserving the
current built-in illustrator behavior.

---

Duplicate comments:
In `@packages/client/src/localization/locales/en.json`:
- Line 4059: Update the localization value for
ui.connections.connectioneditor.imagePromptingInstructionsHelp to remove the
claim about Noodle and additional prompt-writing calls, and describe only the
currently supported selfie and Illustrator flows while preserving the rest of
the guidance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aaa15a2d-92be-471c-add7-513cecd8444e

📥 Commits

Reviewing files that changed from the base of the PR and between ec8a8e3 and be35ad1.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • packages/client/src/components/connections/ConnectionEditor.tsx
  • packages/client/src/lib/connection-transfer.ts
  • packages/client/src/localization/locales/en.json
  • packages/server/src/routes/gallery.routes.ts
  • packages/server/src/routes/generate.routes.ts
  • packages/server/src/routes/generate/retry-agents-route.ts
  • packages/server/src/services/agents/agent-executor.ts
  • packages/server/src/services/generation/conversation-selfie-command-runtime.ts
  • packages/server/src/services/generation/image-prompt-instructions.ts
  • packages/shared/src/constants/defaults.ts
  • packages/shared/src/schemas/connection.schema.ts

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/server/src/routes/generate.routes.ts (1)

3635-3659: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Scope image-prompt instructions per image-capable agent.

This lookup selects only the first matching agent, but the instructions are stored in shared agentContext.memory. If an Illustrator agent and a custom agent with trigger_image_generation are both active, both agents receive the first agent’s connection instructions. The later image handler resolves each result agent’s connection separately, so these values can differ. Illustrator cadence filtering can also remove the selected Illustrator agent while leaving a custom image agent with the wrong instructions.

Resolve the instructions at agent execution time using the current agent ID, or enforce that only one image-capable agent can be active.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/routes/generate.routes.ts` around lines 3635 - 3659,
Remove the single-agent lookup and shared assignment around
imagePromptAgentForInstructions. Resolve and attach normalized image-prompt
instructions during each image-capable agent’s execution, using that agent’s ID
and the same per-agent connection resolution as the later image handler, so
Illustrator cadence filtering and multiple active image agents receive their own
instructions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/server/src/routes/generate.routes.ts`:
- Around line 3635-3659: Remove the single-agent lookup and shared assignment
around imagePromptAgentForInstructions. Resolve and attach normalized
image-prompt instructions during each image-capable agent’s execution, using
that agent’s ID and the same per-agent connection resolution as the later image
handler, so Illustrator cadence filtering and multiple active image agents
receive their own instructions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 46e056a9-9b54-4f17-a0fb-9b51f8ec781b

📥 Commits

Reviewing files that changed from the base of the PR and between be35ad1 and daf3a12.

📒 Files selected for processing (2)
  • packages/client/src/localization/locales/en.json
  • packages/server/src/routes/generate.routes.ts

@snpNEXT

snpNEXT commented Aug 10, 2026

Copy link
Copy Markdown
Author

I wanted to keep the changes surgical but the reviews are asking to touch more and more stuff that I feel I shouldn't be. I'll do as it says but yeah if its too much feel free to not include the next few commits or so.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/server/src/routes/game.routes.ts`:
- Line 10299: Extract and export the existing compactImagePromptInstructions
helper from packages/server/src/services/sidecar/scene-analyzer.ts:120-120,
preserving its trim, whitespace-collapsing, and
MAX_IMAGE_PROMPT_INSTRUCTIONS_LENGTH truncation behavior. Replace the duplicated
inline normalization at packages/server/src/routes/game.routes.ts:10299-10299,
11182-11182, 12032-12032, and 12445-12445, plus
packages/server/src/services/game/game-asset-generation.ts:994-994 and
1128-1128, with imports and calls to this shared helper.

In `@packages/server/src/routes/generate.routes.ts`:
- Around line 4345-4370: Update the automatic retry path around the direct
executeAgent call to resolve the retry context through
resolveImagePromptAgentContext(agentCfg, retryCtx) first, then pass the resolved
context to executeAgent. Preserve the existing retry behavior while ensuring
Illustrator and custom image agents retain _imagePromptInstructions.

In `@packages/server/src/services/agents/agent-executor.ts`:
- Around line 1100-1106: Update every recursive executeAgentBatch call,
including the request-option grouping branch, to pass the existing
resolveAgentContext argument. Ensure resolver-backed agents receive the resolved
context in all batching paths, while preserving the current behavior for calls
without a resolver.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a1bd9ef4-3c8f-40e1-8c9a-d45cd3270a76

📥 Commits

Reviewing files that changed from the base of the PR and between daf3a12 and 69343ed.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • packages/server/src/routes/game.routes.ts
  • packages/server/src/routes/generate.routes.ts
  • packages/server/src/services/agents/agent-executor.ts
  • packages/server/src/services/agents/agent-pipeline.ts
  • packages/server/src/services/game/game-asset-generation.ts
  • packages/server/src/services/sidecar/scene-analyzer.ts
  • packages/shared/src/constants/defaults.ts
  • packages/shared/src/schemas/scene-analysis.schema.ts

Comment thread packages/server/src/routes/game.routes.ts Outdated
Comment thread packages/server/src/routes/generate.routes.ts
Comment thread packages/server/src/services/agents/agent-executor.ts
@snpNEXT

snpNEXT commented Aug 10, 2026

Copy link
Copy Markdown
Author

Okay looks like review bot found everything I think. Still seems to work

@SpicyMarinara

Copy link
Copy Markdown
Collaborator

All looks good, thank you!

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/server/src/services/game/game-asset-generation.ts`:
- Line 994: Remove the raw image instruction append from both the background
provider prompt at
packages/server/src/services/game/game-asset-generation.ts:994-994 and the
scene-illustration provider prompt at
packages/server/src/services/game/game-asset-generation.ts:1128-1128. Route
req.imagePromptInstructions through the text prompt-generation path instead,
ensuring both builders apply the instructions there rather than directly to the
image provider prompt.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d0b37aa5-7f40-425e-9fef-6fa2a1f7077b

📥 Commits

Reviewing files that changed from the base of the PR and between 69343ed and 0c658a3.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • packages/client/src/localization/locales/en.json
  • packages/server/src/routes/game.routes.ts
  • packages/server/src/routes/generate.routes.ts
  • packages/server/src/services/agents/agent-executor.ts
  • packages/server/src/services/game/game-asset-generation.ts
  • packages/server/src/services/sidecar/scene-analyzer.ts

: GAME_BACKGROUND.defaultBuilder(backgroundVars);
const imagePromptInstructionsLine = req.imagePromptInstructions?.trim()
? `User image instructions: ${req.imagePromptInstructions.trim().replace(/\s+/g, " ").slice(0, 5000)}`
? `User image instructions: ${compactImagePromptInstructions(req.imagePromptInstructions)}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Route image instructions through text prompt generation instead of provider prompt construction.

Both builders append the raw instruction block to rawPrompt. This can send the original block directly to the image provider when no dynamic prompt generator is active.

  • packages/server/src/services/game/game-asset-generation.ts#L994-L994: remove the raw instruction append from the background provider prompt and apply the instructions in the text prompt-generation path.
  • packages/server/src/services/game/game-asset-generation.ts#L1128-L1128: apply the same change to the scene-illustration provider prompt.
📍 Affects 1 file
  • packages/server/src/services/game/game-asset-generation.ts#L994-L994 (this comment)
  • packages/server/src/services/game/game-asset-generation.ts#L1128-L1128
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/services/game/game-asset-generation.ts` at line 994,
Remove the raw image instruction append from both the background provider prompt
at packages/server/src/services/game/game-asset-generation.ts:994-994 and the
scene-illustration provider prompt at
packages/server/src/services/game/game-asset-generation.ts:1128-1128. Route
req.imagePromptInstructions through the text prompt-generation path instead,
ensuring both builders apply the instructions there rather than directly to the
image provider prompt.

@SpicyMarinara
SpicyMarinara merged commit 3253847 into Pasta-Devs:staging Aug 10, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants