SIGN IN SIGN UP

feat(harness): add `model` parameter to `HarnessAgent` instead of having each harness adapter support it on their own constructor functions (#19923)

## Background

Model selection was configured separately on every harness adapter,
making it inconsistent. Abstracting it out as a `HarnessAgent` setting
is the logical DX enhancement.

## Summary

Model selection now flows through `HarnessAgent` and
`HarnessV1StartOptions`. Each adapter resolves the harness-specific
string when starting a session, with ACP implementations using a
required callback because their runtimes accept models through different
arguments or environment values.

- Add `model?: string` to `HarnessAgent` and forward it when sessions
start.
- Update every adapter to prefer the agent model while retaining
deprecated factory settings for temporary backward compatibility.
- Add ACP model resolution via `resolveModel()` callbacks and correct
native model arguments for Cursor and Grok Build.
- Add adapter coverage, consistent `with-model` examples, and updated
documentation.

## End-to-End Verification

Ran:

```sh
./tools/run-harness-agent-examples.sh --example with-model
```

## Checklist

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

## Future Work

Allow model selection to change between turns via `prepareCall()`.
F
Felix Arntz committed
76082104acf7de3c932d640932f602424f26e96a
Parent: 99d4211
Committed by GitHub <noreply@github.com> on 8/28/2026, 4:54:22 PM