Skip to content

Fix 5 defects found in v0.6.16 code review#767

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/review-uncommitted-changes
Draft

Fix 5 defects found in v0.6.16 code review#767
Copilot wants to merge 2 commits intomainfrom
copilot/review-uncommitted-changes

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 16, 2026

Code review of v0.6.15→v0.6.16 delta surfaced five defects across tools, LLM providers, and UI.

  • EditFileError TypedDict incorrectly uses total=False — all fields become optional, but _serialize_edit_file_error unconditionally accesses error, message, path. Switched to NotRequired on matches only.

  • _find_match_spans infinite loop on empty stringstr.find("", n) returns n for any valid n, so start never advances. Added early-return guard. Caller validates today, but the private function was unprotected.

  • edit_file missing exception handling — only tool method in LocalFilesystemRuntime without try/except wrapping. Unhandled OSError (ENOSPC, TOCTOU race) would crash the runtime. Added consistent error handling matching sibling methods.

  • In-place message mutation causes instruction duplication on retryOpenAICompatibleLLM._apply_prompt_provider_specific_structured_schema calls multipart_messages[-1].add_text(instructions), mutating the original. When _execute_with_retry retries, instructions accumulate. Fixed by deep-copying the last message before mutation, matching the Bedrock provider pattern:

    # Before (mutates caller's list on every retry)
    multipart_messages[-1].add_text(instructions)
    
    # After (isolated copy)
    last_copy = multipart_messages[-1].model_copy(deep=True)
    last_copy.add_text(instructions)
    multipart_messages = multipart_messages[:-1] + [last_copy]
  • _normalize_reference_token returns "" instead of None — whitespace-only input returned empty string; callers checking is None missed the cancellation signal.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED git conf�� --global _agent/mcp/helpers/content_helpe!.git cal/bin/git (dns block)
  • releases.astral.sh
    • Triggering command: /home/REDACTED/.local/bin/uv uv run scripts/typecheck.py -main/dist/ripgrep/bin/linux-x64/rg conf�� unset --global /opt/pipx_bin/git credential.helpebash (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

review uncommitted changes for defects

Created from VS Code.

…e loop guard, missing exception handling, message mutation on retry, and return type consistency

Agent-Logs-Url: https://github.com/evalstate/fast-agent/sessions/e611f42a-4938-4c52-8f5f-34eeed6c47f2

Co-authored-by: evalstate <1936278+evalstate@users.noreply.github.com>
Copilot AI changed the title [WIP] Review uncommitted changes for defects Fix 5 defects found in v0.6.16 code review Apr 16, 2026
Copilot AI requested a review from evalstate April 16, 2026 17:45
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