Skip to content

fix(discord-bot): handle Discord prompt edits cleanly#98

Open
omegent-app[bot] wants to merge 1 commit into
fork/discordfrom
fix/discord-message-edit-handling
Open

fix(discord-bot): handle Discord prompt edits cleanly#98
omegent-app[bot] wants to merge 1 commit into
fork/discordfrom
fix/discord-message-edit-handling

Conversation

@omegent-app

@omegent-app omegent-app Bot commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Follow-up to #9. Edits are no longer “ignore forever or double-run.”

  • Content-aware claim of Discord message ids (normalize whitespace)
  • Same content (create/update race, embed unfurl): still a no-op
  • Real content edit:
    • drop 📥 queue entry if the message was parked
    • interrupt an active turn and wait until idle (never delete bot messages mid-stream)
    • re-route with previous + updated prompt framing
    • prefer --steer so the correction is not silently re-queued
  • Stream tip cleanup stays on the existing post-settle Working-tip orphan path

Test plan

  • vp test run src/features/MentionRouter.test.ts
  • Short mention → edit while Working → one interrupt, one new turn, no double finals mid-stream
  • Edit a 📥 queued follow-up → old queue entry removed, new text re-routed
  • Edit after idle → correction turn with edit framing
  • Whitespace-only edit → no re-route

@MindfulLearner MindfulLearner self-assigned this Jul 27, 2026
@patroza
patroza force-pushed the fork/discord branch 5 times, most recently from b4fc1d3 to c07b309 Compare July 27, 2026 07:10
Content-aware message claims distinguish create/update races and embed no-ops
from real edits. Edits interrupt any active turn (then wait for idle), drop a
stale 📥 queue entry if present, and re-route with previous/updated prompt
context. Bot stream tips are cleaned only after the turn settles via the
existing Working-tip orphan path — never while generation is still writing.
@patroza
patroza force-pushed the fix/discord-message-edit-handling branch from a005887 to ff6366c Compare July 27, 2026 07:50
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