Commit 04a39ac
feat(types): add "xhigh" to effort Literal (#914)
## Summary
Adds `"xhigh"` to the `effort` `Literal` on both `ClaudeAgentOptions`
and `AgentDefinition`, matching the CLI (`claude --help` lists `low,
medium, high, xhigh, max`) and the TypeScript SDK's `EffortLevel` type.
The docstring is updated to note that `xhigh` is Opus 4.7-specific and
falls back to `high` on other models.
Previously, type checkers rejected `ClaudeAgentOptions(effort="xhigh")`
even though the CLI supports it:
```
error: Argument "effort" to "ClaudeAgentOptions" has incompatible type
"Literal['xhigh']"; expected "Literal['low', 'medium', 'high', 'max'] | None"
```
Addresses the typing half of #834. The error-surfacing half (CLI
validation failures surface as opaque `ProcessError` without stderr)
overlaps with #798.
## Relationship to #835
#835 also adds `xhigh` plus stderr retention, but is based on a pre-#885
main and now conflicts (it touches `_stderr_task_group`, which #885
removed). This PR is the minimal, conflict-free typing-only fix; the
stderr work can land via #828 or a rebased #835.
## Tests
- New `test_effort_accepts_xhigh_level` (AgentDefinition serialization)
and `test_build_command_with_effort_xhigh` (CLI flag construction).
- Full suite: 718 passed, 2 pre-existing failures in
`test_transcript_mirror.py` (eager-flush, from #905) — same baseline as
#908/#909/#911/#912.
- `ruff check` / `ruff format`: clean.
- `mypy src/`: clean.
- Live e2e proof in PR comment below.
## Changelog
### New Features
- Added `"xhigh"` to the `effort` Literal on `ClaudeAgentOptions` and
`AgentDefinition` (#914)
---
_Generated by [Claude
Code](https://claude.ai/code/session_012Qn9YazWceoUqnjM74eJvU)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3caf665 commit 04a39ac
3 files changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
1776 | 1776 | | |
1777 | 1777 | | |
1778 | 1778 | | |
1779 | | - | |
| 1779 | + | |
1780 | 1780 | | |
1781 | 1781 | | |
1782 | 1782 | | |
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
1786 | 1786 | | |
| 1787 | + | |
| 1788 | + | |
1787 | 1789 | | |
1788 | 1790 | | |
1789 | 1791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
602 | 614 | | |
603 | 615 | | |
604 | 616 | | |
| |||
0 commit comments