Skip to content

Add test coverage for unicode_escape decoding in anthropic-text-editor output handling#95

Merged
0xba1a merged 3 commits intobala/escape_anthropic_outputfrom
copilot/sub-pr-93
Jan 5, 2026
Merged

Add test coverage for unicode_escape decoding in anthropic-text-editor output handling#95
0xba1a merged 3 commits intobala/escape_anthropic_outputfrom
copilot/sub-pr-93

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Added test case for the unicode escape decoding logic introduced in line 244 of MicroBot.py. The code handles anthropic-text-editor tool output by decoding unicode-escaped strings (\n, \t) to actual newlines and tabs.

Changes

  • Test coverage: Added test_anthropic_text_editor_unicode_escape_decoding() to verify the decoding logic:

    output_json = json.loads('{"content": "Line 1\\nLine 2\\nLine 3\\tTabbed"}')
    decoded = output_json["content"].encode("utf-8").decode("unicode_escape")
    # Verifies: "Line 1\nLine 2\nLine 3\tTabbed" (actual newlines/tabs, not escaped)
  • Code quality: Moved json import to module level for consistency with Python conventions


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 5, 2026 07:00
…tput

Co-authored-by: 0xba1a <2942888+0xba1a@users.noreply.github.com>
…ertion order

Co-authored-by: 0xba1a <2942888+0xba1a@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix escape string from anthropic text editor Add test coverage for unicode_escape decoding in anthropic-text-editor output handling Jan 5, 2026
Copilot AI requested a review from 0xba1a January 5, 2026 07:04
@0xba1a 0xba1a marked this pull request as ready for review January 5, 2026 08:45
@0xba1a 0xba1a merged commit 2f6201f into bala/escape_anthropic_output Jan 5, 2026
1 check 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.

2 participants