Skip to content

fix(ci): remove commit-msg hook, add live model resolver - #375

Closed
paruff wants to merge 0 commit into
mainfrom
fix/opencode-commit-hook-and-model-resolver
Closed

fix(ci): remove commit-msg hook, add live model resolver#375
paruff wants to merge 0 commit into
mainfrom
fix/opencode-commit-hook-and-model-resolver

Conversation

@paruff

@paruff paruff commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the exact bug that lost real work on this repo's own opencode validation run today (issue #369): opencode found and fixed a genuine 47-file Python 2 except A, B: syntax bug plus the requested feature, 815 tests passing — then git commit failed the local commitizen commit-msg hook (no type prefix), and since the hook blocks commit creation rather than just flagging it after, there was nothing for a backstop to fix. All of that work was lost when the runner tore down.

This repo's opencode.yml never had a commit-msg-hook-install step (that pattern only existed on fawkes), so there's nothing to remove here — this PR is the model resolver and the routing test, ported from paruff/fawkes (#1630 there) after the prei validation run's failure motivated both fixes.

Replaces the hardcoded model: string with a Resolve model step that verifies the preferred model against the live models.dev catalog before use and falls back (with a visible ::warning::) to another free tool-calling model on the same provider if it's been renamed or removed.

Adds tests/unit/test_opencode_routing.py, testing the real if: trigger expression and the resolver's PREFERRED= literals extracted directly from the workflow file. Added noqa: S307 on the eval() call since this repo's ruff config enables that rule (fawkes's doesn't).

Test plan

  • ruff check/ruff format pass
  • mypy passes (confirmed via the pre-commit hook's environment — my direct CLI run hit a Django-plugin init error unrelated to this file)
  • Logic manually verified via standalone module load (this repo's pytest.ini needs plugins not installed in this session)
  • Comment /oc on a test issue to confirm end-to-end, including that the commit actually lands now

🤖 Generated with Claude Code

address,
city,
state,
zip_code,
)
return cast(Decimal, result["median_rent"])
except RentometerError as exc:
logger.warning("Rentometer lookup failed for %s: %s", zip_code, exc)
@paruff paruff closed this Aug 21, 2026
@paruff
paruff force-pushed the fix/opencode-commit-hook-and-model-resolver branch from 38a289b to 8849d12 Compare August 21, 2026 07:51
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