Skip to content

Fix third-party harness model leak in AugmentArgsForTask (REMOTE-2161)#110

Merged
liliwilson merged 1 commit into
mainfrom
oz-agent/fix-third-party-harness-model-leak
Jul 16, 2026
Merged

Fix third-party harness model leak in AugmentArgsForTask (REMOTE-2161)#110
liliwilson merged 1 commit into
mainfrom
oz-agent/fix-third-party-harness-model-leak

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Summary

Mirrors the worker fix from warpdotdev/warp-server#12751 (REMOTE-2161) for the self-hosted oz-agent-worker.

Root cause

Named agents get their base model stamped onto the snapshot. AugmentArgsForTask then forwarded that top-level model_id as --model to any harness, including Claude Code/Codex/Gemini. Those harnesses interpret --model as their own CLI model and rejected the Oz model id (e.g. claude-4-8-opus-high).

Changes

  • internal/types/messages.go — adds Harness.IsOz() helper (nil / empty / "oz" type → true)
  • internal/common/task_utils.go — guards --model emission: only emitted when IsOz() is true
  • internal/common/task_utils_test.go — adds test case: claude harness with an Oz model_id does not produce --model in args

Validation

All tests pass (go test ./internal/...).

Conversation: https://staging.warp.dev/conversation/834798b3-c270-4964-a103-e78f1681049a

Run: https://oz.staging.warp.dev/runs/019f688e-e9ee-7c86-a614-51054d86bce0

This PR was generated with Oz.

Only emit --model for Oz runs. Third-party harnesses (claude, codex,
gemini) resolve their model from the task snapshot's harness config, so
forwarding the top-level Oz model_id as --model caused them to reject
the run (e.g. REMOTE-2161: invalid model 'claude-4-8-opus-high').

- Add Harness.IsOz() helper (nil / empty / 'oz' type → true)
- Guard --model emission with IsOz() check in AugmentArgsForTask
- Add test case covering third-party harness model suppression

Mirrors the equivalent fix in warpdotdev/warp-server#12751.

Co-Authored-By: Oz <oz-agent@warp.dev>
@liliwilson
liliwilson marked this pull request as ready for review July 16, 2026 05:05
@liliwilson
liliwilson merged commit 46c9cde into main Jul 16, 2026
7 checks passed
@liliwilson
liliwilson deleted the oz-agent/fix-third-party-harness-model-leak branch July 16, 2026 05:06
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