Repository navigation
Per-virtual-model repetition_limit override field #69
Copy link
Copy link
Closed
Labels
wayfinder:taskWayfinder ticketWayfinder ticket
Description
Activity
- added a parent issue
on Sep 1, 2026 Scope update from #73: this task now ships two virtual-model fields, not one.
repetition_limit— tri-state*int(unset inherit / 0 explicit off / N on), schema pattern:RawResilienceConfigpointer style.repetition_max_pattern— int, unset = inherit global (default 8), accepted range 1–64.
Both render in the Models view next toslowdown. Validation rejects limit < 0 and pattern outside 1–64.
Repo-conformant notes:
- Add
RepetitionLimit *intandRepetitionMaxPattern *intto the virtual-model config struct ininternal/virtualmodels/. Pointer type matchesRawResilienceConfig(config/resilience.go) for the unset/inherit semantics. - Validation in
internal/virtualmodels/validation.go(existing pattern): rejectRepetitionLimit < 0; rejectRepetitionMaxPatternoutside 1..64; accept nil = inherit. - Wire through the orchestrator:
gateway.InferenceConfig.StreamRepetitionLimitandStreamRepetitionMaxPattern(new fields).StreamChatCompletionandStreamResponsesresolve the effective value per request: per-model field > virtual-model field > workflow field > global default > guard off. - Models-view form: two number inputs next to
slowdownin the existing virtual-model form renderer. Same labels, same disabled-state handling.
Tests: extend
internal/virtualmodels/config_overlay_test.goandinternal/gateway/request_model_resolution_test.gowith the new fields. Pattern: table-driven, assert resolution order. Repo norm: no testify.Minimal-diff: one struct + two fields, one validator, two wiring sites, two form inputs.
- Add
Resolved on feat/stream-repetition-canceller (commits c98d41f, 7567c64).
What changed:
- internal/virtualmodels: RepetitionLimit and RepetitionMaxPattern added to types, config, validation, Mongo/SQL stores, and the admin handler form (next to slowdown).
- config/virtualmodels.go + test: schema support for the two fields.
- internal/virtualmodels/repetition.go: ResolveRepetitionLimit honors alias redirect -> policy -> inherit, with each field independently nullable so an explicit 0 disables the guard.
- internal/core/request_model_resolution.go: added RepetitionLimit / RepetitionMaxPattern to RequestModelResolution.
- internal/gateway: request_model_resolution.go resolves the override, inference_execute.go resolveEffectiveRepetition merges it (nil inherits orchestrator defaults), and StreamResult carries the final pair to WrapDeliveryStream.
- Tests: internal/virtualmodels/repetition_test.go, internal/gateway/inference_execute_repetition_test.go, internal/gateway/request_model_resolution_test.go.
Evidence: go test ./internal/virtualmodels/... ./internal/gateway/... green; a virtual model with repetition_limit: 4 triggers on a 4-repeat loop; no value falls back to the global default.
🤖 Written by Kimi Code (AI agent) from the stream-repetition-canceller worktree.
- added a commit that references this issue
on Sep 3, 2026
Metadata
Metadata
Assignees
Labels
wayfinder:taskWayfinder ticketWayfinder ticket
Derived from: #60, #63
Work:
repetition_limitto the virtual-model config schema ininternal/virtualmodels/.gateway.InferenceConfig.StreamRepetitionLimitso the guard sees the per-request value.Done when: a virtual model with
repetition_limit: 4triggers on a 4-repeat loop; a sibling with no value falls back to the global default.