Conversation
KeremTurgutlu
commented
Sep 29, 2025
| # %% ../nbs/00_core.ipynb | ||
| def msg_insert_line( | ||
| msgid:str, # Message id to edit | ||
| insert_line: int, # The line number after which to insert the text (0 for beginning of file) |
Contributor
Author
There was a problem hiding this comment.
Using the same param comment from claude official docs for docments.
KeremTurgutlu
commented
Sep 29, 2025
Comment on lines
+347
to
+349
| - To get the exact message use `n=0` and `relative=True` together with `msgid`. | ||
| - To get a relative message use `n` (relative position index). | ||
| - To get the nth message use `n` with `relative=False`, e.g `n=0` first message, `n=-1` last message. |
Contributor
Author
There was a problem hiding this comment.
With many different ways to read msgs, this should hopefully guide AI on how to call the read_msg tool properly for a given use case.
KeremTurgutlu
commented
Sep 29, 2025
| - &`msg_str_replace`: Find and replace text in a message. | ||
| - &`msg_strs_replace`: Find and replace multiple strings in a message. | ||
| - &`msg_replace_lines`: Replace a range of lines in a message with new content. | ||
| - Always first use `read_msg( msgid=msgid, n=0, relative=True, nums=True)` to view the content with line numbers.''' |
Contributor
Author
There was a problem hiding this comment.
Here we instruct AI to first read_msg with nums=True before using msg_replace_lines so that it can see the line numbers before setting the start and end line numbers.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR updates
read_msg_to support line numbers and range selection, and implements msg variants of the file edit tools:msg_insert_line_msg_str_replace_msg_strs_replace_msg_replace_lines_This PR depends on the solveit PR: https://github.com/AnswerDotAI/solveit/pull/926
Here is a minimal dialogue showcasing the new tools