Skip to content

[FIX] Update OpenCode and Copilot CLI handlers and paths - #37

Open
xafr-odoo wants to merge 1 commit into
odoo-odev:mainfrom
xafr-odoo:fix-opencode
Open

[FIX] Update OpenCode and Copilot CLI handlers and paths#37
xafr-odoo wants to merge 1 commit into
odoo-odev:mainfrom
xafr-odoo:fix-opencode

Conversation

@xafr-odoo

@xafr-odoo xafr-odoo commented Aug 14, 2026

Copy link
Copy Markdown

Description

Summary

This PR fixes execution, path resolution, and binary naming issues for both the opencode and copilot AI handlers, bringing them up to date with modern CLI package standards.


Key Changes

1. OpenCode Handler (opencode)

  • Binary Name Alignment: Changed binary target from opencode-cli to opencode so the handler works natively out-of-the-box with the current package without requiring manual symlinks.
  • Dynamic Environment Resolution: Replaced hardcoded user NVM/Node paths with dynamic shutil.which lookups and a wildcard version directory scanner.
  • Flag Updates: Replaced unsupported --add-dir flags with --auto for proper non-interactive execution.
  • Type Safety: Ensured consistent string/Path object handling during .exists() checks.

2. Copilot Handler (copilot)

  • Standalone CLI Support: Shifted execution away from the deprecated gh copilot extension wrapper in favor of the official standalone @github/copilot CLI package.
  • Updated Guidance: Updated error logging/install hints to direct users to npm install -g @github/copilot.

Safety & Backward Compatibility Check

  • Fallback Preserved: The binary discovery order checks standard system $PATH first before inspecting local environment fallbacks (~/.local/bin, ~/.nvm/versions/node/*), keeping the handlers compatible with custom user installations.
  • Non-Breaking Defaults: Standard flags like --resume, -m (model selection), and headless prompt switches remain unchanged, ensuring existing workflows continue operating smoothly.

Linked Issues

Link the issues that this PR solves, if any:

Compliance

  • I have read the contribution guide
  • I made sure the documentation is up-to-date both in doctrings and the docs directory
  • I have added or modified unit tests where necessary
  • I have added new libraries to the requirements.txt file, if any
  • I have incremented the version number according the versioning guide
  • The PR contains my changes only and no other external commit

@xafr-odoo
xafr-odoo marked this pull request as ready for review August 14, 2026 15:26
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