The truncation logic and error handling added in e1d3c2b7 (Dec 4, 2025)
was lost when message handling was refactored from slack.ts to main.ts.
Changes:
- Add try/catch to all Slack message functions (respond, replaceMessage,
respondInThread, setTyping, setWorking)
- Truncate main messages at 35K chars (Slack limit 40K)
- Truncate thread messages at 20K chars
- Add helpful user-facing notes when truncation occurs
- Log Slack API errors as warnings instead of crashing
Fixes: msg_too_long API errors causing process crash
Co-authored-by: mom bot <mom-bot@living-bio.iam.gserviceaccount.com>
Commit c04708a7 added strip-ansi@^7.1.0 to coding-agent/package.json
but did not update the lockfile. npm ci fails in CI because
strip-ansi@7.2.0 and ansi-regex@6.2.2 are missing from the lock.
Koffi is only used on Windows for VT input support and fails to build
on Termux/Android and Linux systems without build tools. Moving it to
optionalDependencies allows installation to succeed on all platforms
while maintaining Windows functionality.
strip-ansi is imported in bash-executor.ts and two interactive mode
components but is not declared in package.json dependencies. This
causes ERR_MODULE_NOT_FOUND at runtime in strict package managers
like pnpm that do not hoist undeclared dependencies.
Co-authored-by: Graadient <graadient@users.noreply.github.com>
createBranchedSession() wrote the file and set flushed=true even when the
branched path had no assistant message. The next _persist() call saw no
assistant, reset flushed=false, and the subsequent flush appended all
in-memory entries to the already-populated file, duplicating the header
and entries.
Fix: defer file creation when the branched path has no assistant message,
matching the newSession() contract. _persist() creates the file on the
first assistant response.
closes#1672
- Map redacted_thinking to ThinkingContent with redacted: true instead of
adding a new content type. The opaque payload goes in thinkingSignature,
thinking text is set to "[Reasoning redacted]" so it renders naturally
everywhere. Cross-model transform drops redacted blocks.
- Skip interleaved-thinking-2025-05-14 beta header for Opus 4.6 / Sonnet 4.6
where adaptive thinking makes it deprecated/redundant.
- Do not send temperature when thinkingEnabled is true (incompatible with
both adaptive and budget-based thinking).
Based on #1665 by @tctev