Skip to content

fix: compose model route overrides - #230

Merged
ecarreras merged 1 commit into
mainfrom
fix/composable-model-routes
Oct 2, 2026
Merged

ecarreras merged 1 commit into
mainfrom
fix/composable-model-routes

Conversation

@giscebot

@giscebot giscebot commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • compose every matching model route field by field instead of selecting one route object and stopping
  • keep global action and complexity rules effective when a repository default overrides only thinking
  • preserve repository-specific action, complexity, and intent rules as the most specific overrides
  • document the layered resolution order and partial override semantics

Resolution order

Routes are applied from broad defaults to specific overrides:

  1. global default
  2. repository default
  3. global intent, complexity, then action
  4. repository intent, complexity, then action

Each layer replaces only the model or thinking field it defines. For example:

"gisce/github-agent-bridge": {
  "default": { "thinking": "xhigh" }
}

keeps OpenClaw's inherited model while global mechanical and sync_after_merge routes can still select their cheaper model and thinking level.

Validation

  • pytest -q tests/test_policy.py — 22 passed
  • pytest -q — 382 passed

Requested by: @ecarreras

@ecarreras
ecarreras requested a review from pilipilisbot October 2, 2026 12:43

@pilipilisbot pilipilisbot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. I reviewed the model route composition change in policy.py, the policy reference update, and the added policy tests. The new overlay order preserves global defaults, lets repo defaults override only specified fields, then applies global intent/complexity/action and finally repo-specific overrides, which matches the documented behavior and the PR intent.

Checks run locally on head 83b3a28:

  • pytest -q tests/test_policy.py: 22 passed
  • pytest -q: 382 passed, 1 unrelated Starlette/httpx deprecation warning

CI is also green for dashboard and pytest on Python 3.11/3.12.

@ecarreras
ecarreras merged commit 4aee3e8 into main Oct 2, 2026
3 checks passed
@ecarreras
ecarreras deleted the fix/composable-model-routes branch October 2, 2026 13:01
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.

3 participants