fix(cron): strip internal whitespace from model IDs in cron job normalization#2502
Open
BingqingLyu wants to merge 2 commits into
Open
fix(cron): strip internal whitespace from model IDs in cron job normalization#2502BingqingLyu wants to merge 2 commits into
BingqingLyu wants to merge 2 commits into
Conversation
Owner
Author
|
| Function | File | Also modified by |
|---|---|---|
coercePayload |
src/cron/normalize.ts |
#2127, #2245 |
normalizeMainSystemEventCreateJob |
src/cron/normalize.test.ts |
#2127, #2245, #2444 |
Recommendation: Coordinate with #2127, #2245, #2444 before merging.
Auto-detected by codegraph — a code graph analysis tool built on neug.
25 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
custom-1/ minimax/ minimax-m2.5-free), causing OpenRouter to reject them with400 ... is not a valid model ID (format).coercePayload()andcopyTopLevelAgentTurnFields()insrc/cron/normalize.tsnow strip all internal whitespace frommodelandfallbacksfields via.replace(/\s+/g, '').Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
TrimmedNonEmptyStringFieldSchemaonly.trim()s leading/trailing whitespace. LLMs frequently insert spaces around/and-separators when generating tool call parameters. The normalization layer had no guard against internal whitespace in model IDs.Regression Test Plan (if applicable)
src/cron/normalize.test.tsnormalizeCronJobCreatewith model"custom-1/ minimax/ minimax- m2.5- free"and fallbacks containing internal spaces should output clean IDs with zero whitespace.coercePayloadduring normalization — a unit test onnormalizeCronJobCreatecatches it at the exact mutation point.User-visible / Behavior Changes
Model IDs with accidental internal whitespace are now silently corrected instead of being persisted as-is. No config changes.
Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
custom-1/minimax/minimax-m2.5-freeSteps
custom-1/minimax/minimax-m2.5-freecustom-1/ minimax/ minimax- m2.5- freeExpected
custom-1/minimax/minimax-m2.5-freeActual
custom-1/ minimax/ minimax- m2.5- freeEvidence
53/53 tests pass including new
"strips internal whitespace from model IDs"test.Human Verification (required)
normalizeCronJobCreatewith internal spaces in model and fallbacks fieldsReview Conversations
Compatibility / Migration
Risks and Mitigations
/and-delimiters without spaces.