Skip to content

refactor: fix reliability bugs and reduce code duplication - #59

Open
CoderCookE wants to merge 1 commit into
mainfrom
ec/refactor-reliability-fixes
Open

refactor: fix reliability bugs and reduce code duplication#59
CoderCookE wants to merge 1 commit into
mainfrom
ec/refactor-reliability-fixes

Conversation

@CoderCookE

Copy link
Copy Markdown
Owner
  • Fix VimScript injection: display content now passed via vim.vars instead of string-formatted into vim.command, preventing crashes on backslashes
  • Fix broken :GptBe persona command: was setting g:chat_persona which Python never read; now correctly sets g:llm_agent_persona
  • Fix Anthropic URL construction: use urlparse to handle bare domains, /v1 paths, and full /v1/messages URLs without double-appending
  • Fix save_plan() bypassing get_config(): now respects g:llm_agent_session_mode
  • Fix window focus hijack: display_response() now restores original window after scrolling the chat buffer
  • Fix path prefix guard in context.vim: replace length comparison with stridx() to avoid incorrectly skipping short paths like /srv or /app
  • Remove ~20 lines of unreachable dead code after unconditional break
  • Extract append_tool_results() shared helper to utils.py, eliminating duplicate tool-loop logic and dead format-detection branch in context.py
  • Centralize Python sys.path setup into chatgpt#ensure_python_path(), removing 8 copy-pasted heredoc blocks across autoload files
  • Fix conftest history fixture to use real \x01 delimiters
  • Relax tool count assertion to >= 17
  • Correct README default for summary_compaction_size (50KB -> 75KB)

- Fix VimScript injection: display content now passed via vim.vars instead
  of string-formatted into vim.command, preventing crashes on backslashes
- Fix broken :GptBe persona command: was setting g:chat_persona which
  Python never read; now correctly sets g:llm_agent_persona
- Fix Anthropic URL construction: use urlparse to handle bare domains,
  /v1 paths, and full /v1/messages URLs without double-appending
- Fix save_plan() bypassing get_config(): now respects g:llm_agent_session_mode
- Fix window focus hijack: display_response() now restores original window
  after scrolling the chat buffer
- Fix path prefix guard in context.vim: replace length comparison with
  stridx() to avoid incorrectly skipping short paths like /srv or /app
- Remove ~20 lines of unreachable dead code after unconditional break
- Extract append_tool_results() shared helper to utils.py, eliminating
  duplicate tool-loop logic and dead format-detection branch in context.py
- Centralize Python sys.path setup into chatgpt#ensure_python_path(),
  removing 8 copy-pasted heredoc blocks across autoload files
- Fix conftest history fixture to use real \x01 delimiters
- Relax tool count assertion to >= 17
- Correct README default for summary_compaction_size (50KB -> 75KB)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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