Repository navigation
Stream repetition canceller — wayfinder map #53
Description
Activity
- added sub-issues
on Sep 1, 2026 Implementation status — stream-repetition-canceller worktree.
Work completed and pushed to fork branch feat/stream-repetition-canceller:
- Replace byte-period detection with token-based per-chunk detection #66 token-based per-chunk detection — closed
- Add lazy tiktoken loader with byte-period fallback #67 lazy tokenizer via omnitoken v0.1.7 — closed
- Add Prometheus counter for repetition triggers #68 Prometheus counter gomodel_stream_repetition_triggers_total — closed
- Per-virtual-model repetition_limit override field #69 per-virtual-model repetition_limit + repetition_max_pattern — closed
- Extend repetition guard to passthrough routes #70 passthrough SSE guard wiring — closed
- Add obvious-code and tool-call skip heuristic #71 skip heuristics (fenced code, tables, whitespace, encoded blobs, tool_calls) — closed
Branch has 8 Conventional Commits ahead of origin/main (825d10e..3c8414e). go build ./... and targeted tests green. Brown harness persisted at .tmp/stream-repetition-brown/.
Still open:
- Documentation, YAML example, and end-to-end smoke test #72 docs / end-to-end smoke / 99% streaming coverage (currently 85.2%).
Loop paused by user on 2026-09-02 to draft a generalized cron/wayfinder skill.
🤖 Written by Kimi Code (AI agent) from the stream-repetition-canceller worktree.
Map complete — all build-plan tasks done.
- Replace byte-period detection with token-based per-chunk detection #66 token-based detection — closed
- Add lazy tiktoken loader with byte-period fallback #67 lazy tokenizer — closed
- Add Prometheus counter for repetition triggers #68 Prometheus counter — closed
- Per-virtual-model repetition_limit override field #69 per-virtual-model fields — closed
- Extend repetition guard to passthrough routes #70 passthrough wiring — closed
- Add obvious-code and tool-call skip heuristic #71 skip heuristics — closed
- Documentation, YAML example, and end-to-end smoke test #72 docs, YAML, e2e smoke, 99% coverage — closed (100% on new code)
Branch feat/stream-repetition-canceller on the fork: 10 Conventional Commits ahead of origin/main (825d10e..d6d49ab), pushed, working tree clean, all targeted tests green.
Remaining open decision: the map destination says merge-ready on the fork — open a PR against the fork's main branch, or keep iterating on the branch first?
This comment was generated with AI assistance.
Defered
Destination
The stream-repetition-canceller is merge-ready: every open design decision about the repetition guard prototype is resolved, so the prototype on
feat/stream-repetition-cancellercan be finalized, reviewed, and merged on the fork (weselben/GoModel; never upstream ENTERPILOT/GoModel without explicit user request).Notes
/home/agent/workspaces/gomodel/.worktrees/stream-repetition-canceller, branchfeat/stream-repetition-canceller.825d10e3..ae2c283a. Implementation follow-ups from decisions: remove holdback queue + straddling rewrite; per-chunk eager trigger; metric/log per Observability: log line only, or also a Prometheus metric on trigger? #61; kill switch per Kill-switch env + finish_reason on truncated SSE #63; tokenizer per Tokenizer library selection for the repetition guard #64.grillinganddomain-modelingskills.STREAM_REPETITION_LIMITis unset/0.Decisions so far
Detection unit — token-based detection chosen; blocked on tokenizer selection; byte-period stays as fallback until then.
Holdback vs eager — eager per-chunk check, no holdback, no back-truncation; leak of up to one detection window accepted.
On-trigger action — silent cut + server-side metric/log; client intact; end turn so a new request unblocks quickly; skip obviously-code repetition.
Keep semantics — superseded: no rewrite/strip step under eager mode.
Detection unit — B: token-based via tiktoken; own file; lazy-loaded only when guard active for a model. (Closed after Tokenizer library selection for the repetition guard #64 unblocked.)
Tokenizer selection — tiktoken, latest/fastest pure-Go port; lazy-loaded; byte-period as fallback when vocabulary missing. (Closed.)
Kill switch / per-model activation — opt-in per-model field in the Models view (next to slowdown); global default stays as off; no separate runtime kill switch. (Closed.)
Prior art survey — reopened pending token lens (Tokenizer library selection for the repetition guard #64); byte-period defaults (max_unit 64 / min_repeats 3 / window 4096) retained as the fallback path's reference.
Observability — B: slog + counter
gomodel_stream_repetition_triggers_total{provider,model}; no histogram for v1.Config granularity — global default (env/YAML) + per-virtual-model override; per-provider rejected; threshold may vary per model.
Virtual-model semantics + max-pattern knob —
0beats global / unset inherits;repetition_max_patternper-model field +STREAM_REPETITION_MAX_PATTERNglobal (default 8); env names unchanged. (Closed.)Not yet specified
Build plan
All decisions landed. The remaining work is implementation, not decisions. Each step lists the ticket(s) it derives from.
Out of scope