[PR #6664] [MERGED] fix(agents): honor output limits and NanoGPT Kimi reasoning support #7276

Closed
opened 2026-10-23 04:18:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6664
Author: @SpicyMarinara
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/25/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/6658-6659-agent-request-limits


📝 Commits (3)

  • 4d5babc docs(changelog): track assigned agent request fixes
  • 40f6fc3 fix(agents): honor manual output limits and Kimi K3 reasoning support
  • d8d6770 Merge branch 'staging' into codex/6658-6659-agent-request-limits

📊 Changes

6 files changed (+67 additions, -13 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/src/services/agents/agent-executor.ts (+1 -1)
📝 packages/server/src/services/generation/illustrator-manual-prompt-generation.ts (+12 -11)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+2 -1)
📝 scripts/regressions/prompt.regression.ts (+25 -0)
📝 scripts/regressions/provider-compat.regression.ts (+25 -0)

📄 Description

Linked issue

Closes #6658
Closes #6659

Why this change

Automatic agent runs on NanoGPT Kimi K3 fail when JSON output forces unsupported reasoning_effort: none. Manual Illustrator requests also silently cap output at 1,800 tokens, which can truncate otherwise valid image-prompt JSON despite a higher configured limit.

What changed

  • Map an explicit reasoning disable to low for NanoGPT Kimi K3 in the existing request builder. NanoGPT documents low/high/max as K3's supported levels. Requests that omit the parameter or disable its send switch still omit it; other models retain their existing handling.
  • Reuse the existing agent token normalizer and connection/model cap helper for manual Illustrator requests. A configured 32,800-token limit can reach the provider; 1,800 is only the fallback for an unconfigured limit. Apply the effective cap before checking the context budget.
  • Extend the existing provider and prompt regression suites, with no new dependency or UI changes.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • 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

Local validation completed:

  • pnpm check — passed, including localization, formatting, lint/type checks and production builds.
  • pnpm regression:prompt — all three suites passed.
  • node scripts/run-regressions.mjs --filter scripts/regressions/provider-compat.regression.ts — passed.
  • node scripts/run-regressions.mjs --filter scripts/regressions/agent-runtime.regression.ts — passed.

Regressions used isolated temporary data directories. Before the fixes, the new cases reproduced both defects: none instead of low, and 1,800 instead of 32,800 tokens. Coverage checks actual NanoGPT-shaped HTTP requests, manual Illustrator provider options, connection/model caps, unconfigured limits, omitted/disabled reasoning parameters, and the older Kimi model's existing behavior. Existing oversized-context and retry protections also pass.

Local CodeRabbit review completed with zero findings across all six changed files. No live paid-model request or container/browser manual verification has been performed.

Manual verification notes

  • Manually verify that automatic Character Tracker and Illustrator runs complete on NanoGPT Kimi K3.
  • Manually verify that a manual illustration uses the configured output limit, subject to connection and model limits, and returns complete JSON.

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 (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Changelog entries included. No version bump or user-facing documentation change.

UI evidence (if applicable)

Server request handling only; no visual changes.

Summary by CodeRabbit

  • Bug Fixes
    • NanoGPT Kimi K3 runs no longer send an unsupported reasoning setting.
    • Manual Illustrator requests now honor configured output-token limits, subject to connection and model caps, instead of being capped at 1,800 tokens.
  • Tests
    • Added regression coverage for token-limit handling and reasoning settings across Kimi models.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6664 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/25/2026 **Status:** ✅ Merged **Merged:** 9/25/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/6658-6659-agent-request-limits` --- ### 📝 Commits (3) - [`4d5babc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4d5babcfdbf52390eab86a9c0702b57cfd3c959f) docs(changelog): track assigned agent request fixes - [`40f6fc3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/40f6fc3a32796fada98ac7aa8a4df02eb0249392) fix(agents): honor manual output limits and Kimi K3 reasoning support - [`d8d6770`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d8d6770069c66d5120c141ec1bf515c318217ec7) Merge branch 'staging' into codex/6658-6659-agent-request-limits ### 📊 Changes **6 files changed** (+67 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/src/services/agents/agent-executor.ts` (+1 -1) 📝 `packages/server/src/services/generation/illustrator-manual-prompt-generation.ts` (+12 -11) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+2 -1) 📝 `scripts/regressions/prompt.regression.ts` (+25 -0) 📝 `scripts/regressions/provider-compat.regression.ts` (+25 -0) </details> ### 📄 Description ## Linked issue Closes #6658 Closes #6659 ## Why this change Automatic agent runs on NanoGPT Kimi K3 fail when JSON output forces unsupported `reasoning_effort: none`. Manual Illustrator requests also silently cap output at 1,800 tokens, which can truncate otherwise valid image-prompt JSON despite a higher configured limit. ## What changed - Map an explicit reasoning disable to `low` for NanoGPT Kimi K3 in the existing request builder. [NanoGPT documents low/high/max as K3's supported levels](https://nano-gpt.com/blog/kimi-k3-chinese-open-weight-ai). Requests that omit the parameter or disable its send switch still omit it; other models retain their existing handling. - Reuse the existing agent token normalizer and connection/model cap helper for manual Illustrator requests. A configured 32,800-token limit can reach the provider; 1,800 is only the fallback for an unconfigured limit. Apply the effective cap before checking the context budget. - Extend the existing provider and prompt regression suites, with no new dependency or UI changes. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] 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` Local validation completed: - `pnpm check` — passed, including localization, formatting, lint/type checks and production builds. - `pnpm regression:prompt` — all three suites passed. - `node scripts/run-regressions.mjs --filter scripts/regressions/provider-compat.regression.ts` — passed. - `node scripts/run-regressions.mjs --filter scripts/regressions/agent-runtime.regression.ts` — passed. Regressions used isolated temporary data directories. Before the fixes, the new cases reproduced both defects: `none` instead of `low`, and 1,800 instead of 32,800 tokens. Coverage checks actual NanoGPT-shaped HTTP requests, manual Illustrator provider options, connection/model caps, unconfigured limits, omitted/disabled reasoning parameters, and the older Kimi model's existing behavior. Existing oversized-context and retry protections also pass. Local CodeRabbit review completed with zero findings across all six changed files. No live paid-model request or container/browser manual verification has been performed. ### Manual verification notes - Manually verify that automatic Character Tracker and Illustrator runs complete on NanoGPT Kimi K3. - Manually verify that a manual illustration uses the configured output limit, subject to connection and model limits, and returns complete JSON. ## 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 (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Changelog entries included. No version bump or user-facing documentation change. ## UI evidence (if applicable) Server request handling only; no visual changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * NanoGPT Kimi K3 runs no longer send an unsupported reasoning setting. * Manual Illustrator requests now honor configured output-token limits, subject to connection and model caps, instead of being capped at 1,800 tokens. * **Tests** * Added regression coverage for token-limit handling and reasoning settings across Kimi models. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:11 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7276
No description provided.