← Back to PRs

#11273: fix(telegram): prevent status command crash during thinking

by avirweb open 2026-02-07 16:59 View on GitHub →
channel: telegram stale
## Summary - Prevent `/status` from crashing while model thinking state is active. - Ensure session/config access remains safe during status rendering. - AI-Assisted: Yes (built with Claude/OpenCode) ## Testing - Verified branch diff against `upstream/main` is non-zero. - Verified branch head SHA matches expected prepared commit. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR makes three small changes: - Replaces `console.warn` with the project logger (`logWarn`) during session fork initialization (`src/auto-reply/reply/session.ts`). - Adjusts the default `staleMs` used by the session-store file lock to be a function of `timeoutMs`/`pollIntervalMs` (`src/config/sessions/store.ts`). - Wraps Telegram native slash command dispatch in a `try/catch` so `/status` (and other commands) won’t crash the handler during transient session-state errors, and sends a user-facing retry message on failure (`src/telegram/bot-native-commands.ts`). These changes are intended to keep status rendering resilient while the model is thinking and to make session/config access safer under concurrency, but the new lock-staleness heuristic needs adjustment to avoid overlapping writers. <h3>Confidence Score: 3/5</h3> - This PR is mergeable after fixing the session-store lock staleness regression - Most changes are localized and improve resiliency/logging, but the updated `staleMs` default can cause active locks to be evicted when callers use small `timeoutMs` values, enabling overlapping writers to the session store. - src/config/sessions/store.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs