Repository navigation
fix(task-bridge): lift conversation.log line cap from 200 → 2000 chars - #609
Merged
Merged
Conversation
Per Susan 2026-05-05: voice transcripts in conversation.log were getting truncated mid-sentence — visible especially with longer turns and CJK text where each char can be multi-byte at the layer above. The 200-char cap was aggressive and made the log unreadable for normal-length user/assistant exchanges. Bump to 2000 (matches Discord's per-message limit, so a single log line never exceeds what could legitimately appear in the conversation surface). Both call sites updated. Tunable via SUTANDO_LOG_LINE_MAX_CHARS env if a host wants tighter logs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sonichi
reviewed
May 5, 2026
sonichi
left a comment
Owner
There was a problem hiding this comment.
LGTM (commenting since GH won't approve sonichi PRs… but this is liususan091219; commenting anyway because Mini-bot doesn't have approve rights either).
Verified:
- Both 200-char call sites updated (line 238
logConversation, line 553[task:N]summary). No otherslice(0, 200)in task-bridge.ts. ✓ LOG_LINE_MAX_CHARS = Number(process.env.SUTANDO_LOG_LINE_MAX_CHARS) || 2000—Number(undefined)→NaN→ falsy → falls through to 2000.Number("0")→ 0 → falsy → 2000. The latter is a minor footgun if a host explicitly wants 0 to disable, but probably fine — env override at 0 isn't a real use case.- conversation.log on this Mini is 105KB after ~3 days, append-only, no rotation. 10x cap → maybe 1MB after similar period. No concern.
- CJK rationale checks out — JS slice operates on UTF-16 code units; 200 of those is ~30 English words, ~30-50 CJK characters at most. Frequent mid-sentence cuts. 2000 is the right neighborhood.
Gate check (community PR per repo norm):
- Import strategy: no new imports ✓
- Defaults: 2000 matches Discord per-message limit; env-tunable down for tighter hosts ✓
- Bind-address: N/A ✓
One non-blocker observation: log rotation is the missing piece — conversation.log is unbounded. Not in scope here, but if growth ever becomes a concern (e.g. after a long voice session), a tail -n N rotation policy or daily-bucket files would close that out. Today's file size makes it a future-not-now problem.
Approve. Recommend merging via gh pr merge --squash (no --delete-branch per repo norm).
liususan091219
added a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
sonichi#609) Per Susan 2026-05-05: voice transcripts in conversation.log were getting truncated mid-sentence — visible especially with longer turns and CJK text where each char can be multi-byte at the layer above. The 200-char cap was aggressive and made the log unreadable for normal-length user/assistant exchanges. Bump to 2000 (matches Discord's per-message limit, so a single log line never exceeds what could legitimately appear in the conversation surface). Both call sites updated. Tunable via SUTANDO_LOG_LINE_MAX_CHARS env if a host wants tighter logs. Co-authored-by: Xueqing Liu <xueqingliu@Xueqings-Mac-Studio.local> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Why
Per Susan 2026-05-05: voice transcripts in
conversation.logwere getting truncated mid-sentence. The 200-charslice()cap was aggressive — visible especially with longer user turns and CJK text where each char can cost 2-4 bytes at the layer above. Made the log unreadable for normal-length user/assistant exchanges.What changes
src/task-bridge.ts— bump the slice cap from 200 → 2000.SUTANDO_LOG_LINE_MAX_CHARSenv override.logConversation()and the[task:N]summary log).Test plan
npx tsc --noEmit— cleanconversation.logfor a longer user turn (>200 chars) and verify it's not truncated. Re-truncation visible if env override is set.🤖 Generated with Claude Code