-
Notifications
You must be signed in to change notification settings - Fork 95
feat(claude): remove coder_report_task tool call message #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e9428ba
feat(claude): remove coder_report_task tool call message
35C4n0r 16b51ac
wip
35C4n0r 1ad5dd3
feat: add test
35C4n0r 9a6bb43
feat: add test
35C4n0r f7a2863
wip
35C4n0r c384607
wip
35C4n0r 690f46c
wip
35C4n0r 18d6edc
chore: update readme.md
35C4n0r 0a6733a
chore: update tests
35C4n0r fdfb178
feat: update logic
35C4n0r c2313e0
feat: update logic
35C4n0r 372c138
feat: add logging
35C4n0r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
lib/msgfmt/testdata/format/claude/remove-task-tool-call/expected.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| ● I'll build a snake game for you. Let me start by reporting my | ||
| progress and creating a task list. | ||
|
|
||
| ● Now I'll create a complete snake game with HTML, CSS, and | ||
| JavaScript: | ||
|
|
||
| ● Write(snake-game.html) | ||
| ⎿ Wrote 344 lines to snake-game.html | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, | ||
| initial-scale=1.0"> | ||
| <title>Snake Game</title> | ||
| <style> | ||
| * { | ||
| margin: 0; | ||
| padding: 0; | ||
| … +334 lines (ctrl+o to expand) | ||
|
|
||
| ● I've built a complete snake game for you! The game is saved | ||
| at /home/coder/snake-game.html. | ||
|
|
||
| Features: | ||
| - Classic snake gameplay with smooth controls | ||
| - Use arrow keys to control the snake | ||
| - Press SPACE to pause/unpause | ||
| - Score tracking with increasing difficulty (speed increases | ||
| every 5 points) | ||
| - Colorful gradient background and styled UI | ||
| - Game over screen with restart option | ||
| - Snake grows when eating food | ||
| - Collision detection for walls and self-collision | ||
|
|
||
| How to play: | ||
| Open the HTML file in your web browser and use the arrow keys | ||
| to move the snake. Collect the red food to grow and increase | ||
| your score! |
72 changes: 72 additions & 0 deletions
72
lib/msgfmt/testdata/format/claude/remove-task-tool-call/msg.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| > Build a snake game | ||
|
|
||
| ● I'll build a snake game for you. Let me start by reporting my | ||
| progress and creating a task list. | ||
|
|
||
| ● coder - coder_report_task (MCP)(summary: "Building a snake game | ||
| with HTML/CSS/JavaScript", link: | ||
| "", state: "working") | ||
| ⎿ { | ||
| "message": "Thanks for reporting!" | ||
| } | ||
|
|
||
| ● Now I'll create a complete snake game with HTML, CSS, and | ||
| JavaScript: | ||
|
|
||
| ● Write(snake-game.html) | ||
| ⎿ Wrote 344 lines to snake-game.html | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, | ||
| initial-scale=1.0"> | ||
| <title>Snake Game</title> | ||
| <style> | ||
| * { | ||
| margin: 0; | ||
| padding: 0; | ||
| … +334 lines (ctrl+o to expand) | ||
|
|
||
| ● coder - coder_report_task (MCP)(summary: "Snake game created | ||
| successfully at snake-game.html", | ||
| link: "file:///home/coder/snake-ga | ||
| me.html", state: "working") | ||
| ⎿ { | ||
| "message": "Thanks for reporting!" | ||
| } | ||
35C4n0r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| ● I've built a complete snake game for you! The game is saved | ||
| at /home/coder/snake-game.html. | ||
|
|
||
| Features: | ||
| - Classic snake gameplay with smooth controls | ||
| - Use arrow keys to control the snake | ||
| - Press SPACE to pause/unpause | ||
| - Score tracking with increasing difficulty (speed increases | ||
| every 5 points) | ||
| - Colorful gradient background and styled UI | ||
| - Game over screen with restart option | ||
| - Snake grows when eating food | ||
| - Collision detection for walls and self-collision | ||
|
|
||
| How to play: | ||
| Open the HTML file in your web browser and use the arrow keys | ||
| to move the snake. Collect the red food to grow and increase | ||
| your score! | ||
|
|
||
| ● coder - coder_report_task (MCP)(summary: "Snake game created | ||
| successfully at snake-game.html", | ||
| link: "file:///home/coder/snake-ga | ||
| me.html", state: "working") | ||
| ⎿ { | ||
| "message": "Thanks for reporting!" | ||
| } | ||
|
|
||
|
|
||
| ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── | ||
| > | ||
| ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── | ||
| ? for shortcuts ⧉ In message_box.go | ||
|
|
||
1 change: 1 addition & 0 deletions
1
lib/msgfmt/testdata/format/claude/remove-task-tool-call/user.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Build a snake game |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that
● coder - coder_report_task (MCP)is the last entry, and there won't be a next message with●? In which I assume we'd remove all the remaining lines?Asking because I don't see handling for this case (unless I'm just missing it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafredri
Added the logic to handle this case. This handles the case where this is the last thing claude outputs is the tool call, and it also acts as a failsafe if the next new message is not prefixed with ●.
I'm checking for a newline after the tool-call and not directly using len(lines) in above case, because I never want to run into this:
In which I assume we'd remove all the remaining lines?