Skip to content

Speed up cold startup and keep Telegram menus responsive during card recovery - #415

Merged
Time4Mind merged 2 commits into
mainfrom
fix/fast-card-startup
Nov 26, 2026
Merged

Time4Mind merged 2 commits into
mainfrom
fix/fast-card-startup

Conversation

@Time4Mind

Copy link
Copy Markdown
Owner

Changes

  • Read large transcript records in linear time and bound tool previews before formatting. Preserve user messages and final answers.
  • Restore OpenCode status from the latest visible native message and use the message index for transcript parts.
  • Complete the first Telegram poll immediately. Use the configured proxy first, with a direct fallback after a connection failure or five seconds of connection setup. Retry a rich send only when the failed connection could not have delivered it.
  • Correlate each incoming /menu with the outgoing menu ID in the log.

Verification

The test suite passed with 2,527 tests and two skips. Ruff, Pyright and the module size check passed.

Replaying 50 turns from a 272 MiB transcript restored 1,967 card events in 1.34 seconds. The concurrent menu send was acknowledged by Telegram in 0.15 seconds on the test bot. Restoring status for 13 sessions took 0.07 seconds. In the accepted production deployment, 3.54 seconds elapsed from restart initiation to the first successful Telegram poll.

@Time4Mind
Time4Mind merged commit df4373a into main Nov 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant