Repository navigation
fix(bus): detect DashScope input length range as context overflow - #49
Conversation
DashScope rejects over-long prompts with "Range of input length should be [1, 98304]", which was not recognised as a context window overflow. Added the phrasing to the hint list and documented that this matcher is a deliberate copy of tinyinference's, kept in sync by hand because the contract crate stays dependency-free. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe context-window overflow detector now recognizes errors containing “range of input length should be.” Documentation and tests cover the new match and a temperature-range error that should not match. ChangesDashScope Overflow Detection
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change makes DashScope input-length range errors count as context-window overflows. It also keeps temperature-range errors from matching. The risk is low. Before merging, confirm that the tinyinference matcher contains the same phrase. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
A rabbit checks the error line Comment |
Tiny Sweeper reviewTiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Ready for maintainer review Review snapshot
Completeness: Complete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. How this fits togetherflowchart LR
n0["should_skip_memory_context_entry<br/>changed"]:::changed
n1["build_memory_context"]:::impacted
n2["Memory"]:::impacted
n3["MockMemory"]:::impacted
n4["ChatMessage"]:::impacted
n5["ConversationHistoryMap"]:::impacted
n1 -->|calls| n0
n1 -->|uses| n2
n3 -->|implements| n2
n5 -->|uses| n4
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.0009 · 26,577 in / 1,443 out · 4,940 cached (19%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0002 · 4,432 in / 86 out · 0 cached (0%) · gpt-5.6-luna
security: $0.0006 · 11,088 in / 500 out · 1,868 cached (17%) · gpt-5.6-luna
tests: $0.0000 · 4,183 in / 86 out · 1,536 cached (37%) · glm-5.3-flash
description: $0.0000 · 4,181 in / 53 out · 1,408 cached (34%) · glm-5.3-flash
Summary
is_context_window_overflow_messageintinychannels-bus(crates/tinychannels-bus/src/context.rs) is a copy ofis_context_window_exceeded_messagein tinyinference'scrates/tinyinference-llm/src/failure.rs, and the copy had fallen behind. I diffed the two match lists in full against tinyinferencemain(c71e6b5). The only gap is the Alibaba / DashScope (Qwen) arm,"range of input length should be". Without it, a DashScope overflow such asRange of input length should be [1, 98304]was not treated as context overflow on the channels path.The other context hints, the paired
n_keep/n_ctxarm, the token hints and the rate-limit markers already match between the two copies.The doc comment now says the function must track
failure.rsand gives the reason it is duplicated:tinychannels-busis the contract crate, it stays dependency-free, and so it cannot depend on the inference stack.API Or Behavior Changes
No API change, and the signature is the same. DashScope "Range of input length should be [...]" errors are now classified as context-window overflow.
Tests
context_overflow_matches_dashscope_input_length_rangeuses the exact body from tinyinference'scontext_window_matches_dashscope_input_length_range.context_overflow_ignores_other_dashscope_parameter_errorsis a negative case: the same DashScopeinvalid_parameter_errorenvelope with a non-length range (Range of temperature should be [0, 2)) is not matched.cargo fmt --check(clean)cargo clippy --all-targets -- -D warnings(clean)cargo clippy --all-targets --all-features -- -D warnings(clean)cargo build --all-targets(via clippy/test)cargo build --all-targets --all-features(via clippy/test)cargo test(937 + 194 + 3 + 13 passed)cargo test --all-features(943 + 194 + 3 + 13 passed)cargo test -p tinychannels-bus(194 passed),cargo test -p tinychannels(800 passed)Documentation
The doc comment on
is_context_window_overflow_messagerecords the parity requirement. No other docs are affected.Summary by CodeRabbit