Skip to content

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

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

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
@patroza
patroza force-pushed the fix/discord-message-edit-handling branch from a005887 to ff6366c Compare July 27, 2026 07:50
@patroza
patroza force-pushed the fix/discord-message-edit-handling branch from ff6366c to 9a593c5 Compare July 27, 2026 10:57
@patroza
patroza force-pushed the fix/discord-message-edit-handling branch from 9a593c5 to 9bc8815 Compare July 27, 2026 11:56
@patroza
patroza force-pushed the fix/discord-message-edit-handling branch 2 times, most recently from f8e0766 to 5080cdf Compare July 27, 2026 12:56
@patroza
patroza force-pushed the fix/discord-message-edit-handling branch from 5080cdf to dedb09f Compare July 27, 2026 13:13
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 dedb09f to d970558 Compare July 27, 2026 15:53
@patroza

patroza commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Editing does not fit the Agent Model, so let's leave it.

@patroza patroza closed this Jul 27, 2026
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.

2 participants