Repository navigation
feat: support native additional workspace directories - #346
Merged
Merged
Conversation
Merged
xxchan
added a commit
that referenced
this pull request
Oct 11, 2026
Release OAR and CLI 0.55.0. This PR changes only the two package version fields. Both additions come from comparing OAR with the Claude Agent SDK and the codex SDK (#342): in common host scenarios OAR should be no worse than a runtime's own SDK, without depending on it. **Added: `SessionOptions.additionalDirectories`** (#338, #346) - Extra workspace directories beside `cwd`, resolved relative to `cwd`, through each runtime's own setting: claude `--add-dir`, codex `runtimeWorkspaceRoots` (with `cwd` first; OAR refuses the open when codex's answer does not confirm them), cursor `local.dirs`, and the ACP `additionalDirectories` session parameter where the runtime declares it (kimi, OpenCode v2). - kimi applies them only when creating a session: a non-empty list on resume is refused, because kimi ignores it there. OpenCode v1, grok, antigravity, pi and pi-durable refuse the option (`UnsupportedOptionError`). - Give the list again on resume. Without it, claude drops the earlier directories and codex restores its saved ones. - It neither changes the sandbox mode nor isolates anything. Whether project rules or instruction files in the extra directories load is the runtime's own behavior and not guaranteed (claude loads their CLAUDE.md only with `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1`). **Added: `SessionOptions.outputSchema` and `TurnOutcome.structuredOutput`** (#337, #349) - A JSON Schema for the session's final output, passed through unchanged. OAR never validates the schema or the output. - claude applies it at launch to every turn, including turns it starts on its own, and a completed turn carries claude's validated value as `structuredOutput`. A completed claude turn can still lack the field when the model never supplies a value: check for the field, not only `kind`. When the model keeps producing invalid output, the turn fails (`error_max_structured_output_retries`). - grok carries it on every prompt, queued input and steer, and returns its validated value; a value or schema error (`structuredOutputError`) is a failed turn. - codex sends it on every turn OAR starts and returns text only: the provider enforces the schema and the host parses the text. Steered input keeps the current turn's schema. `queue` is refused while a schema is set, because a queued input cannot carry it. Turns codex starts by itself for an active goal carry no schema. - Other runtimes refuse the option. **Behavior changes** - `RefusableSessionOption` gains `"additionalDirectories"` and `"outputSchema"`; hosts with an exhaustive `switch` need the new cases. - `TurnOutcome`'s completed variant gains the optional `structuredOutput`. - On codex, `queue` is rejected `unsupported` in a session opened with `outputSchema`. Validation: #346 and #349 each passed all 17 checks on their final heads, and each merged tree equals its CI tree. Lookout verified both with no account, against real claude 2.1.296, codex 0.162.1, kimi 2.1.1 and grok 1.0.50 with a mock provider: directories in requests and readbacks for new and resumed sessions in all three codex sandbox modes, the refusal paths, valid and invalid structured output on each runtime, queue and steer, and replay equal to live. Otter's native evidence and probes are in `experiments/additional-directories-2026-10-11.md` and `experiments/structured-output-2026-10-11.md`. After this PR passes CI and merges, tag its exact squash commit as `v0.55.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hosts can now pass
SessionOptions.additionalDirectoriesinstead of constructing native flags. Paths resolve relative tocwd, which remains primary; omitted or empty lists add no override.Claude, Codex and Cursor map new and resumed sessions to their native settings. Kimi supports new sessions but explicitly refuses a nonempty list on resume because the native path ignores it. OpenCode v2 requires its advertised ACP capability; v1, Grok, Antigravity, Pi and Pi Durable refuse the option. Codex checks the returned workspace roots and preserves the existing sandbox mode; an explicit list replaces its native root configuration.
Project rule/instruction loading is separate from workspace access. The native evidence report records Claude's opt-in for additional CLAUDE.md files and Cursor's verified workspace metadata alongside the rule-marker probes that did not succeed. Exhaustive switches on
RefusableSessionOptionneed the new value.Validation: full check (1,649 unit tests), build, all five behavior backends, five native vendor cases, and native Claude/Codex/Kimi/OpenCode probes passed. Cursor create/resume workspace metadata was verified using the authorized existing xxwork login; usage and evidence limits are in the report.
Closes #338.