Commit Graph

12 Commits

Author SHA1 Message Date
drew 6178be3aa7 feat(models): single-source model registry via models.yaml + sync_models.py
.opencode/models/models.yaml is now the ONE file humans edit to assign a
model to an agent. tools/sync_models.py regenerates every derived surface
— the .opencode/models/*.txt files, opencode.json's `agent` block, and
each non-tier agent's .md `model:` frontmatter — so an assignment cannot
drift across surfaces. `--check` verifies with no writes and is enforced
in CI by test_model_registry_in_sync_with_manifest.

Hardened after adversarial review:
- Deletes orphan <agent>.txt files left behind when an override is
  dropped from the manifest. The dispatcher's resolver reads
  <agent>.txt before default.txt, so a stale file would silently pin
  the old model. Tier .txt files are left to sync_tier_models.py.
- Rejects a manifest key that does not name a real agent (no matching
  .opencode/agents/<name>.md) instead of silently appending a bogus
  opencode.json entry and leaving the real agent on the default model.
- Validates the regenerated opencode.json BEFORE writing it, so a bad
  render aborts cleanly instead of corrupting the file on disk.

Tier-ladder agents (task-implementor-tier-*) remain governed separately
by tiers.yaml + sync_tier_models.py and are passed through untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 07:33:18 -04:00
drew 132a5a2269 feat(auto-agents): centralise model registry under .opencode/models with session-create model stamp
Every agent's model assignment now lives in a single-line text file at
.opencode/models/<name>.txt; default.txt is the 27-agent catch-all.
opencode.json's agent.<name>.model uses
{file:./.opencode/models/<name>.txt} interpolation, and
tools/_opencode_worker.py reads the same files at session-create to
stamp the resolved model on the session record (observability + drift
sentinel; OpenCode does NOT propagate session-level model to
prompt_async — schema for that is undocumented and deferred to Stage
2). 39 .md frontmatter `model:` lines stripped; the two intentional
inheritors (task-implementor, agent-evolution-pool-supervisor) keep
their model-less frontmatter.

Operator workflow for swapping a model is now: edit
.opencode/models/<role>.txt, restart OpenCode so opencode.json's
{file:...} re-resolves, run the dispatcher. Live-swap without restart
was attempted (override on prompt_async); OpenCode 0.x silently
dropped those requests (200 OK, no assistant message) and the
prompt_async override was reverted. The session-create override
remains for observability + drift detection.

End-to-end validation (2026-05-10): dispatch_review.py on PR #25 with
default.txt=openai/gpt-5-mini produced a clean REQUEST_CHANGES review
in 26 s for ~$0.016; dispatch_implementer.py on PR #30 with
tier-qwen-* files remapped to openai/{gpt-5-nano, gpt-5-mini,
gpt-5-codex} ran the full implementation-worker → tier-dispatcher →
estimator-implementation → tier-qwen-med → task-implementor →
git-isolator-util chain in 16 min with model=gpt-5-mini end-to-end.

Also documents the printenv VAR form as the only allowed env-read in
implementation-worker.md and task-implementor.md (live testing
showed the worker burning 2–4 turns on permission-denied
trial-and-error trying printf and echo variants).

Tests: 21 in tests/auto_agents/test_opencode_worker_models.py
(resolver semantics with caplog assertions on every malformed-input
path; session-create body shape; prompt_async body never carries
model; three repo-level invariants — every {file:...} reference
resolves, every .md is wired or in the inheritor allowlist, no .md
has a model: frontmatter). 1027 auto_agents tests pass / 3 skipped.

Note: .opencode/models/default.txt and the three tier-qwen-*.txt
files are committed with their OpenAI swaps in place (gpt-5-mini,
gpt-5-nano, gpt-5-mini, gpt-5-codex respectively) because the
CleverThis HuggingFace endpoints are paused. Revert with `git diff
HEAD~1 -- .opencode/models/*.txt | git apply -R` if/when they come
back.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 17:23:06 -04:00
drew e247c10219 chore(opencode): reconcile providers and agents with agents/final-working
Imports the source-of-truth tier selector shape (tier-qwen-small/med/
large, tier-kimi) and the explicit-only variable-propagation contract
from agents/final-working, while preserving this branch's deterministic
merge_drive.py / conflict_drive.py ownership model and the
implementer/reviewer claim-release behavior so LLM workers do not race
the host drivers. Rebuilds root opencode.json so host-launched OpenCode
sees the same live HF endpoints as the devcontainer, and corrects
pipeline-agent model pins to the live default
CleverThis-15/Qwen3-6-35B-A3B-GGUF-UD-Q3-K-XL after CleverThis-8 was
decommissioned. Drops the stale single tier-qwen selector. Telemetry
pricing keys are updated to match the new model pin.

Scope is intentionally limited to provider/model routing and agent-
definition reconciliation; the Tier 2 deterministic dispatchers and
their telemetry land in a separate commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 22:41:41 -04:00
freemo ce396d2b43 build: reordered agent perms
CI / benchmark-publish (push) Waiting to run
CI / push-validation (push) Successful in 30s
CI / helm (push) Successful in 42s
CI / build (push) Successful in 47s
CI / quality (push) Successful in 1m14s
CI / lint (push) Successful in 1m25s
CI / typecheck (push) Successful in 1m35s
CI / security (push) Successful in 1m34s
CI / e2e_tests (push) Successful in 5m57s
CI / integration_tests (push) Successful in 7m11s
CI / unit_tests (push) Successful in 9m0s
CI / docker (push) Failing after 1s
CI / coverage (push) Successful in 12m23s
CI / status-check (push) Failing after 3s
2026-05-02 14:33:45 -04:00
freemo 9632ea55dd build: trying new qwen instruct model instead
CI / status-check (push) Blocked by required conditions
CI / lint (push) Successful in 48s
CI / typecheck (push) Successful in 1m15s
CI / security (push) Successful in 1m14s
CI / quality (push) Successful in 41s
CI / push-validation (push) Successful in 30s
CI / helm (push) Successful in 42s
CI / build (push) Successful in 47s
CI / integration_tests (push) Successful in 4m13s
CI / e2e_tests (push) Successful in 5m6s
CI / unit_tests (push) Successful in 6m25s
CI / docker (push) Successful in 1m46s
CI / coverage (push) Failing after 17m43s
CI / benchmark-publish (push) Has started running
2026-05-01 20:03:27 -04:00
freemo bdcc44cb09 build: read and write permissions set seperate edit since read seems to be getting denied as does write
CI / helm (push) Successful in 39s
CI / lint (push) Successful in 57s
CI / build (push) Successful in 53s
CI / quality (push) Successful in 1m24s
CI / typecheck (push) Successful in 1m30s
CI / security (push) Successful in 1m43s
CI / integration_tests (push) Successful in 3m31s
CI / e2e_tests (push) Failing after 3m49s
CI / push-validation (push) Successful in 25s
CI / unit_tests (push) Successful in 4m42s
CI / docker (push) Successful in 1m28s
CI / coverage (push) Successful in 10m44s
CI / status-check (push) Failing after 3s
CI / benchmark-publish (push) Successful in 1h30m7s
2026-05-01 17:58:29 -04:00
freemo 3a6d42ee79 build: fixed some bad permissions and no longer require prompt to be written to a file for supervisors
CI / status-check (push) Blocked by required conditions
CI / push-validation (push) Successful in 31s
CI / helm (push) Successful in 50s
CI / build (push) Successful in 56s
CI / lint (push) Successful in 1m12s
CI / security (push) Successful in 1m27s
CI / typecheck (push) Successful in 1m39s
CI / quality (push) Successful in 1m37s
CI / integration_tests (push) Successful in 3m46s
CI / e2e_tests (push) Successful in 4m10s
CI / unit_tests (push) Successful in 4m55s
CI / coverage (push) Has started running
CI / docker (push) Successful in 1m26s
CI / benchmark-publish (push) Has started running
2026-05-01 17:45:27 -04:00
freemo 9b34d47371 build: new models
CI / benchmark-publish (push) Has started running
CI / push-validation (push) Successful in 48s
CI / helm (push) Successful in 1m8s
CI / build (push) Successful in 1m9s
CI / lint (push) Successful in 1m29s
CI / quality (push) Successful in 1m32s
CI / typecheck (push) Successful in 1m36s
CI / security (push) Successful in 1m35s
CI / integration_tests (push) Successful in 5m21s
CI / unit_tests (push) Successful in 6m0s
CI / e2e_tests (push) Successful in 6m6s
CI / docker (push) Successful in 1m27s
CI / coverage (push) Successful in 23m45s
CI / status-check (push) Successful in 6s
2026-05-01 16:32:39 -04:00
freemo 816c16901b build: fixed uncensored model
CI / build (push) Successful in 1m4s
CI / lint (push) Successful in 1m15s
CI / quality (push) Successful in 1m20s
CI / typecheck (push) Successful in 1m43s
CI / security (push) Successful in 1m57s
CI / helm (push) Successful in 42s
CI / benchmark-publish (push) Failing after 36s
CI / integration_tests (push) Successful in 4m35s
CI / e2e_tests (push) Successful in 5m40s
CI / unit_tests (push) Successful in 6m11s
CI / push-validation (push) Successful in 23s
CI / docker (push) Successful in 1m37s
CI / coverage (push) Successful in 12m23s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 30s
CI / helm (pull_request) Successful in 35s
CI / build (pull_request) Successful in 1m4s
CI / lint (pull_request) Successful in 1m22s
CI / quality (pull_request) Successful in 1m23s
CI / security (pull_request) Successful in 1m38s
CI / typecheck (pull_request) Successful in 2m3s
CI / unit_tests (pull_request) Successful in 4m40s
CI / integration_tests (pull_request) Successful in 5m11s
CI / e2e_tests (pull_request) Successful in 5m38s
CI / docker (pull_request) Successful in 1m27s
CI / coverage (pull_request) Successful in 10m45s
CI / status-check (pull_request) Successful in 3s
2026-04-30 20:02:13 -04:00
freemo 516c600c0e build: updated and rename hosted models
CI / status-check (push) Blocked by required conditions
CI / lint (push) Successful in 49s
CI / typecheck (push) Successful in 1m25s
CI / security (push) Successful in 1m23s
CI / quality (push) Successful in 40s
CI / push-validation (push) Successful in 35s
CI / helm (push) Successful in 42s
CI / build (push) Successful in 54s
CI / benchmark-publish (push) Failing after 43s
CI / integration_tests (push) Successful in 4m41s
CI / e2e_tests (push) Successful in 5m9s
CI / unit_tests (push) Successful in 5m56s
CI / coverage (push) Has started running
CI / docker (push) Successful in 1m36s
2026-04-30 19:47:54 -04:00
freemo 1691def164 build: Moved to using new default qwen instance
CI / build (push) Successful in 1m0s
CI / lint (push) Successful in 1m17s
CI / quality (push) Successful in 1m24s
CI / typecheck (push) Successful in 1m32s
CI / security (push) Successful in 1m49s
CI / benchmark-publish (push) Failing after 39s
CI / push-validation (push) Successful in 24s
CI / helm (push) Successful in 25s
CI / integration_tests (push) Successful in 3m40s
CI / e2e_tests (push) Successful in 4m8s
CI / unit_tests (push) Successful in 4m53s
CI / docker (push) Successful in 1m42s
CI / coverage (push) Successful in 11m13s
CI / status-check (push) Successful in 3s
2026-04-30 16:12:38 -04:00
freemo 1885990081 build: auto opencode agents rewritten
CI / build (push) Waiting to run
CI / docker (push) Blocked by required conditions
CI / helm (push) Waiting to run
CI / push-validation (push) Waiting to run
CI / status-check (push) Blocked by required conditions
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
CI / security (push) Waiting to run
CI / quality (push) Waiting to run
CI / unit_tests (push) Waiting to run
CI / integration_tests (push) Waiting to run
CI / e2e_tests (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / benchmark-publish (push) Waiting to run
2026-04-27 12:49:08 -04:00