Skip to content

Let Sharpie edit their last answer when asked to correct it - #12

Merged
HarryCordewener merged 1 commit into
claude/discord-markdownfrom
claude/sharpie-edits
Dec 2, 2026
Merged

HarryCordewener merged 1 commit into
claude/discord-markdownfrom
claude/sharpie-edits

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Requested by Grave · project thread

This PR is stacked on #11 and targets its branch. GitHub retargets it to main when #11 is merged.

What changes

  • New edit_answer tool: It takes the whole corrected answer. The rules tell Sharpie to use it when a member asks them to correct, fix or change something in their earlier answer in the post, or when they spot a mistake themselves, and then to write one short line saying what changed.
  • Checks in the tool: DocsTools refuses an edit that is empty, longer than one message (1,900 characters), or that WritingCheck flags (banned wording, softcode outside code). The tool result asks for a fix, and Sharpie calls again. Edits don't get the one-shot rewrite a final reply gets, so this is their quality gate.
  • Editing in Discord: The bot finds Sharpie's latest answer in the post: their own message carrying the Solved button. If that answer is one message, the bot edits its content in place. The buttons stay, and the transcript shows the new text from then on. Then it replies to the member with Edited my answer: <link> and Sharpie's note.
  • Fallback: If the answer was split over several messages, or can't be found, the correction is posted as a new answer with buttons.
  • Log: The edit is logged as an answer with an [Edited] prefix, with the corrected text and the note.
  • Docs: The README and CHANGELOG describe the behaviour.

Testing

  • DocsToolsTests (new): an edit carries the text, and empty, banned or too-long edits are refused. These tests didn't build before EditAnswer existed.
  • PromptTests: the rule is in the system prompt.
  • 105 tests pass, dotnet build has no warnings, and dotnet format --verify-no-changes is clean.
  • Not tested: the Discord side (ModifyAsync on Sharpie's own message, the jump link). After you redeploy, ask Sharpie a question, then reply "that's wrong, X should be Y" in the post.

🤖 Generated with Claude Code

A new edit_answer tool takes the whole corrected answer. The bot edits
Sharpie's most recent answer in place, keeping its buttons, and replies
"Edited my answer" with a link and Sharpie's note on what changed. The
tool refuses empty, too-long or banned wording so Sharpie fixes it and
calls again; an answer split over several messages gets the correction
as a new answer instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HarryCordewener HarryCordewener self-assigned this Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 9 billable files and costs up to $2.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 29 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 62 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 32326a9b-d445-4f9d-9ed4-13e5c3ab0af5
Commits

Reviewing files that changed from the base of the PR and between 4603db1 and 872f676.

Files selected for processing: 9

  • CHANGELOG.md
  • README.md
  • src/Sharpie.Core/Answering/Answer.cs
  • src/Sharpie.Core/Answering/Answerer.cs
  • src/Sharpie.Core/Answering/DocsTools.cs
  • src/Sharpie.Core/Answering/SharpiePrompt.cs
  • src/Sharpie/SharpieBot.cs
  • tests/Sharpie.Tests/DocsToolsTests.cs
  • tests/Sharpie.Tests/PromptTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@HarryCordewener
HarryCordewener added this pull request to stack #13 December 2, 2026 22:57
@HarryCordewener
HarryCordewener marked this pull request as ready for review December 2, 2026 22:57
@HarryCordewener
HarryCordewener merged commit 2bbb770 into main Dec 2, 2026
3 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