[GH-ISSUE #6718] [Issue]: Open-Jev 2B gets a flat 4-second limit, so a long chat with more than about 16 decision statements times out and every statement reads as no #3766

Closed
opened 2026-10-21 06:06:59 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Sep 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6718

Originally assigned to: @kolacheee on GitHub.

The Open-Jev 2B decision sidecar gets a flat 4 seconds per request, however many decision statements a turn asks. Each statement reads the recent chat again, so on a long chat a turn with more than about 16 statements runs past 4 seconds. The request is abandoned, and every statement in it reads as no for that turn. The default Decision statements per turn is 32.

How to reproduce (try it yourself)

  1. Select Decision sidecar — Open-Jev 2B as the Decision model.
  2. In a preset, add 24 different decision statements, for example {{#if decision:"The scene changed location."}}The scene has moved.{{/if}}, each with its own statement.
  3. Use a chat whose last few messages are long (several paragraphs each).
  4. Send a message.

What you'll see: every one of the 24 branches is left out of the prompt, even the ones that are clearly true. The server log shows [decision] Activation request failed: timeout. The same statements answer normally on a short chat.

What should happen: the statements get answers.

Measured through the engine's own decision backend (resolveDecisionBackend → askMixed) against the real Open-Jev 2B, with five long messages trimmed to the model's limit, on staging 77d4b0e57:

Statements in one request Answered Time
16 16 3.97 s, just under the limit
24 0 stopped at 4.0 s (timeout)
32 0 stopped at 4.0 s (timeout)

A Choice statement costs one statement per option, so fewer Choice statements are enough to hit it.

Where it is

  • packages/shared/src/types/decision-catalog.ts: the Open-Jev 2B entry has no perQuestionMs. Open-Jev 9B has 800.
  • packages/server/src/services/decision/decision-default.ts: the sidecar request limit is min(20 s, 4 s + perQuestionMs × (questions − 1)), so 2B always gets 4 s.

What's happening

The prefix cache stays off, so every statement, and every Choice option, re-reads the whole recent chat. The cost grows with both, at about 0.25 s per statement on a long chat. A timed-out request is not cached, so later requests in the same turn ask the same statements again and can time out again.

Suggested fix

Give Open-Jev 2B a measured perQuestionMs, the same way 9B has one. The budget then grows with the number of statements and Choice options. At the model's own full length (3,479 tokens), a statement costs 0.33 s, so about 350 ms covers it.

Context

Staging only: the decision sidecar arrived in #6556 and prompt decision statements in #6572. Investigated with an AI agent; verify before fixing.

Originally created by @kolacheee on GitHub (Sep 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6718 Originally assigned to: @kolacheee on GitHub. The Open-Jev 2B decision sidecar gets a flat 4 seconds per request, however many decision statements a turn asks. Each statement reads the recent chat again, so on a long chat a turn with more than about 16 statements runs past 4 seconds. The request is abandoned, and every statement in it reads as no for that turn. The default **Decision statements per turn** is 32. ## How to reproduce (try it yourself) 1. Select **Decision sidecar — Open-Jev 2B** as the **Decision model**. 2. In a preset, add 24 different decision statements, for example `{{#if decision:"The scene changed location."}}The scene has moved.{{/if}}`, each with its own statement. 3. Use a chat whose last few messages are long (several paragraphs each). 4. Send a message. **What you'll see:** every one of the 24 branches is left out of the prompt, even the ones that are clearly true. The server log shows `[decision] Activation request failed: timeout`. The same statements answer normally on a short chat. **What should happen:** the statements get answers. Measured through the engine's own decision backend (`resolveDecisionBackend` → `askMixed`) against the real Open-Jev 2B, with five long messages trimmed to the model's limit, on staging `77d4b0e57`: | Statements in one request | Answered | Time | | --- | --- | --- | | 16 | 16 | 3.97 s, just under the limit | | 24 | 0 | stopped at 4.0 s (timeout) | | 32 | 0 | stopped at 4.0 s (timeout) | A Choice statement costs one statement per option, so fewer Choice statements are enough to hit it. ## Where it is - `packages/shared/src/types/decision-catalog.ts`: the Open-Jev 2B entry has no `perQuestionMs`. Open-Jev 9B has 800. - `packages/server/src/services/decision/decision-default.ts`: the sidecar request limit is `min(20 s, 4 s + perQuestionMs × (questions − 1))`, so 2B always gets 4 s. ## What's happening The prefix cache stays off, so every statement, and every Choice option, re-reads the whole recent chat. The cost grows with both, at about 0.25 s per statement on a long chat. A timed-out request is not cached, so later requests in the same turn ask the same statements again and can time out again. ## Suggested fix Give Open-Jev 2B a measured `perQuestionMs`, the same way 9B has one. The budget then grows with the number of statements and Choice options. At the model's own full length (3,479 tokens), a statement costs 0.33 s, so about 350 ms covers it. ## Context Staging only: the decision sidecar arrived in #6556 and prompt decision statements in #6572. Investigated with an AI agent; verify before fixing.
bsakaguchi 2026-10-21 06:06:59 +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#3766
No description provided.