Skip to content

feat(tasklist): show full prompt for truncated task details#192

Open
H-TTTTT wants to merge 1 commit into
grinev:mainfrom
H-TTTTT:fix/tasklist-long-prompt
Open

feat(tasklist): show full prompt for truncated task details#192
H-TTTTT wants to merge 1 commit into
grinev:mainfrom
H-TTTTT:fix/tasklist-long-prompt

Conversation

@H-TTTTT

@H-TTTTT H-TTTTT commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Tapping a scheduled task whose prompt exceeds the detail budget currently shows only a truncated prompt (added in #172 to keep editMessageText under Telegram's 4096-byte limit). The rest of the prompt is silently lost.

This adds a 📄 Show full prompt button to the task detail view (only when the prompt was actually truncated). Tapping it replies with the complete prompt, split across multiple messages when it exceeds the Telegram limit.

Changes

  • buildTaskDetailsKeyboard now accepts { showFullPrompt } and renders a tasklist:prompt:<id> button only when the prompt exceeds the detail budget.
  • New tasklist:prompt:<id> callback handler in scheduled-task-callback-handler.ts:
    • Active only from the detail stage for the matching task (inactive alert otherwise).
    • Replies with the full prompt, byte-chunked to stay ≤ 4096 bytes per message.
  • Added isTaskDetailPromptTruncated + byte-aware chunkTextByByteLength helpers (consistent with the existing byte-aware truncatePromptForDetails).
  • New i18n keys tasklist.button.show_prompt and tasklist.full_prompt_header across all 7 locales (ar, de, en, es, fr, ru, zh).

Why not edit the existing message?

The full prompt can be far larger than 4096 bytes, so it cannot replace the detail view via editMessageText. Sending it as follow-up message(s) keeps the detail card intact while revealing the full prompt.

Verification

  • npm run build (tsc --noEmit) — clean
  • npm run lint (eslint --max-warnings=0) — clean
  • npm test — 1158 tests pass (124 files), including 5 new tests covering: button shown when truncated, hidden when short, full-prompt reply, multi-message chunking, and inactive-stage rejection.

Fixes #147

Task detail prompts longer than the detail budget are truncated to keep the
message under Telegram's 4096-byte editMessageText limit (grinev#172). Truncated
prompts are now surfaced with a 'Show full prompt' button on the task detail
view. Tapping it replies with the complete prompt, split across messages when
it exceeds the Telegram limit, so long prompts are no longer silently lost.

Fixes grinev#147
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.

bug(tasklist): task detail view silently fails when prompt exceeds ~3 870 chars (Telegram 4 096-byte editMessageText limit)

1 participant