Skip to content

feat(compress): add provider model selection - #783

Open
ousamabenyounes wants to merge 1 commit into
JuliusBrussee:mainfrom
ousamabenyounes:fix/issue-759
Open

feat(compress): add provider model selection#783
ousamabenyounes wants to merge 1 commit into
JuliusBrussee:mainfrom
ousamabenyounes:fix/issue-759

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Fixes #759

Summary

  • Add env-driven provider routing for caveman-compress: default Claude path, explicit anthropic, and explicit opencode.
  • Add compress-specific model env support through CAVEMAN_COMPRESS_MODEL, with CAVEMAN_MODEL as fallback.
  • Send opencode prompts through a temporary --file attachment instead of argv, then delete the temp file.
  • Document provider/model env behavior and security implications.

CI will resync plugins/caveman/skills/caveman-compress/... on merge.

Test verification (RED -> GREEN)

RED, upstream behavior ignored opencode provider and still called Claude CLI:

FAIL: test_opencode_provider_uses_configured_model
Expected: run(['/usr/local/bin/opencode', 'run', '--model', 'github-copilot/gpt-4.1', 'Compress this memory.'], ...)
  Actual: run(['/usr/local/bin/opencode', '--print'], input='Compress this memory.', ...)
FAILED (failures=1, errors=1)

RED, Claude CLI ignored configured model:

FAIL: test_claude_cli_uses_configured_model
Expected: run(['/usr/local/bin/claude', '--model', 'claude-haiku-4-5', '--print'], ...)
  Actual: run(['/usr/local/bin/claude', '--print'], ...)
FAILED (failures=1)

RED, opencode path needed non-argv prompt attachment:

ERROR: test_opencode_provider_uses_configured_model
ValueError: '--file' is not in list
FAILED (errors=1)

GREEN, provider/model tests:

Ran 3 tests in 0.002s

OK

Full local CI baseline on upstream main:

# tests 112
# pass 112
python compress safety: Ran 5 tests ... OK

Full local CI final branch:

# tests 112
# pass 112
python compress safety: Ran 8 tests ... OK

Review gates:

contribute-code:     PASS
local-ci-docker:     PASS
pr-check:            PASS
ocr-codex:           PASS
main-codex-review:   PASS

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.

opencode - support other models support other models

1 participant