## Summary
On a Windows host the on-call flow could not run a job: the process
backend's launcher is a `/bin/sh` script (`setsid`, `trap`, `kill -0`,
`stat -c`), so every job stayed RUNNING forever and the spend scan
billed nothing, quietly.
- New `windows` job backend (`oncall_flow/windows_backend.py`): the same
submit / poll / fetch_result / cancel / fetch_progress contract, written
in Python. Liveness uses `raven.utils.pid.pid_alive` (`os.kill(pid, 0)`
terminates a process on Windows). Cancel is a tree kill with `taskkill
/T`. The job is started through a short-lived relay, so it is nobody's
child: stopping the host with `taskkill /T` (which walks parent pids,
whatever the creation flags) no longer kills a running job. Measured: a
20-minute job survived the page being stopped and wrote its result.
- `backends.py`: registers `windows`, and routes a local `process`
campaign to it on Windows, since that is what the agent declares for a
command on the owner's machine.
- A POSIX `remote_dir` (the `/root/raven-ops` submit default, which
never reaches `meta.json`) maps to `~/raven-ops`, so the submit path and
the status path look in the same directory.
- `ledger.py`: skip the directory fsync on Windows (opening a directory
raises EACCES; NTFS journals the rename).
- `tui_commands.py` / `_tui_relay.py`: do not forward SIGINT to the
child on Windows. The console already delivers Ctrl+C to it, and
`Popen.send_signal(SIGINT)` raises ValueError, which took the TUI down.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
On Windows 11, Python 3.13, `uv sync --extra dev`, `PYTHONUTF8=1`:
- `uv run pytest tests/ -k "oncall_flow or tui or acp_commands or
ledger"`
- this branch: 14 failed, 1091 passed, 15 skipped, 18 errors
- `origin/main`: 126 failed, 976 passed, 15 skipped, 18 errors
- no test fails on this branch that passes on `origin/main`; the
remaining failures and the 18 collection errors are identical on both
(POSIX shell tests, missing optional modules).
- `uv run pytest tests/test_agents_oncall_flow_windows_backend.py`: 3
passed, including a job that survives `taskkill /T` of the process that
submitted it.
- `uv run ruff check` and `uv run ruff format --check` on the changed
files: clean.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No user-facing docs describe on-call backends per platform, so none were
changed.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
Behaviour changes only on Windows (`os.name == "nt"` / `sys.platform ==
"win32"` guards); POSIX hosts take the same code paths as before. A job
started on Windows now outlives the host by design; `cancel` still stops
it. Rollback: revert this commit.
## Related Issues
N/A
---------
Co-authored-by: silverLXT <xiaotian.luo@evermind.ai>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
An on-call agent's question to its owner never reached the owner when
the agent ran as an ACP sub-agent. `ops_ask_owner` handed the allowed
question back to the model to send with the `message` tool. Over ACP
that text goes into the running turn: the host gathers it into the run's
transcript, and since a sub-agent's result is its last message, the main
session never receives it. In a recorded run the agent asked how the
owner wanted an acceptance standard read, and nobody saw the question.
Nothing kept the question open either. The question trail treated any
later note as an answer, so the loop's own progress note closed it, and
it then closed the campaign around the question.
What changes, all inside the on-call plugin (no host or ACP change):
- **Delivery.** An allowed question is put through the host's existing
`direct_ask` grant on a task of its own, and the tool returns at once so
the loop carries on. In the on-call agent this goes through the
runtime's question broker to the ACP bridge, which sends
`elicitation/create` to a host that declared form support. The host's
existing handling applies: the form is shown for the broker's while, and
the host model may fill an answer only from what the owner already said
this turn. Without the grant, the model-mediated text is returned as
before.
- **Answers.** A non-empty answer is written to the notes as the
owner's, tagged with the question's id. It is logged as `owner_answered`
and pulls the campaign's wake to now. An empty answer (the form timed
out, was dismissed, or was displaced by another question) is logged as
`ask_owner_unanswered` and leaves the question open. The ten-minute wake
the ask already arms then runs the existing no-answer choice: do work
that does not depend on the answer, wait once more, or close. Nothing is
re-sent automatically.
- **Arguments.** `options` (the choices, each with its cost) and a
required `if_unanswered` (the default the loop follows when nobody
answers). The description asks for questions about goals and standards
rather than about how to do the work, written so someone who does not
know the method can answer them.
- **Question state.** Every ask carries an `ask_id`. A question is
closed in three ways:
- the owner speaks after it: an answer to that id, or anything they type
into the window;
- `ops_note` with `settles_question=true`, when the loop goes ahead on
its default;
- it is withdrawn, because a new question replaces it or the campaign
closes.
Notes the loop writes about its own work no longer close a question, and
an answer to an older question does not close a newer one. Asks recorded
before ids existed keep the old reading, so campaigns already on disk
read the same.
- **Closing.** `ops_finish` still refuses while a question is open. It
takes down a form still showing, and the report gets one `decided
without the owner` line per question that was settled on its default and
never answered.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
New tests:
- `tests/test_agents_oncall_flow_policy.py`, the question trail:
- the loop's own note does not close a question with an id, and the
owner speaking does;
- settling on the default closes it and is listed as decided without the
owner, until the owner answers after all;
- an answer to an older question leaves the newer one open.
- `tests/test_agents_oncall_flow_escalation_tools.py`, the tool:
- the tool returns while the grant is still waiting;
- the answer lands in the notes as the owner's and pulls the wake (real
`CronService` behind the grant);
- an empty answer leaves the question open;
- a new question withdraws the previous one;
- settling then closing works and the report says so;
- without the grant, the message-tool text is returned;
- one test runs the real path past the grant: `QuestionBroker` to
`AcpQuestions` to an `elicitation/create` frame, whose answer comes back
as the owner's.
Mutants, each killed:
- never using the grant: 6 failed
- any note closing a question with an id: 3 failed
- an owner note for another question closing it: 1 failed
- close not withdrawing the form: 1 failed
- report omitting the undecided questions: 1 failed
Commands:
- `uv run --no-sync pytest -q -p no:randomly
tests/test_agents_oncall*.py tests/test_acp_*.py tests/test_ask_user*.py
tests/test_subagent_acp.py tests/test_cron_*.py
tests/test_question_broker.py`: 2745 passed, 9 skipped, 1 failed. The
failure is
`tests/test_acp_leftovers.py::test_on_macos_the_watcher_ends_nothing_when_the_agent_does_not_lead_its_group`.
It is intermittent on this machine and fails the same way on a tree
without this change (4 of 5 runs). This change does not touch it.
- `ruff check` and `ruff format --check` on the changed files: clean
- `uv run --no-sync ty check
agents/raven-oncall/plugins/oncall-flow/oncall_flow/`: all checks passed
- `uv run --no-sync lint-imports`: 10 kept, 0 broken
- `scripts/check_commit_messages.py`,
`scripts/check_source_language.py`, `scripts/check_large_files.py` over
`main..HEAD`: all pass
Not run: the full `make test-python` suite, and a run with a real model
and a real host TUI.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
Behaviour changes for the on-call agent:
- The owner sees its questions as a form in the host instead of never
seeing them.
- `ops_ask_owner` requires `if_unanswered`.
- A note the loop writes no longer closes an open question; the loop has
to say `settles_question=true`.
While a question's form is showing, the host's question slot for that
conversation is in use, as with any sub-agent question today.
Rollback is reverting this commit. Campaign files written by it remain
readable by the old code, which ignores the new fields.
## Related Issues
N/A
Co-authored-by: xiaotian.luo <xiaotian.luo@thetahealth.ai>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
Add a Machines tab to the Agent Hub and let owners register an SSH
machine with either a key or a password.
- The Machines tab reuses the existing machine cards, details and
registration form. The hub remembers the last selected module. Machine
details show the login method, and removal explains that the locally
stored password is deleted.
- Password registrations keep a 0600 credential file under the Raven
home's 0700 keys directory. Registration, node installation, file tools,
tunnels and Oncall use the shared SSH askpass transport. Passwords are
excluded from command lines, registry rows and responses, and included
in held-secret scrubbing.
- Password connections authenticate independently, disable inherited
jump hosts, and answer only the registered account's password prompts.
Oncall cannot redirect a stored password to another endpoint. Windows
rejects this mode before creating credentials because its OpenSSH cannot
execute Raven's POSIX helper. Key authentication remains supported as
before.
- Concurrent registrations preserve the successful request's password.
Each probe uses its own temporary 0600 credential file, which is
scrubbed and removed afterwards. Password writes receive a file
identity; cleanup checks ownership under the writer's lock. Successful
registration checks duplicates again and publishes its password with the
registry row under that lock. Both completion orders, RPC cancellation
and CLI aborts are covered.
The RPC contract adds optional `MachineRow.auth` and password
registration parameters. English and Chinese machine documentation, the
runtime context and changelog describe the resulting behavior.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
After rebasing onto the latest main:
```bash
uv run --no-sync pytest tests/test_ops_connection_add.py tests/test_ops_connections.py tests/test_ops_transport.py tests/test_cli_ops_connection_commands.py tests/test_rpc_machines.py tests/test_held_secrets_machine_passwords.py tests/test_acp_remote.py tests/test_node_client.py tests/test_rpc_schema_match.py tests/test_rpc_registration.py tests/test_import_cycle_budget.py -q -n 0 --tb=short --cov=raven.ops.connection_add --cov=raven.ops.transport --cov=raven.cli.ops_connection_commands --cov=raven.rpc.methods.machines --cov-report=json:/tmp/pr1005-fix-coverage.json
```
Result: 932 passed, 6 skipped. The skipped cases require zsh, tcsh or
csh, which are absent on this Linux host.
- `uv run --no-sync python scripts/coverage_gate.py --coverage-json
/tmp/pr1005-fix-coverage.json diff --base-ref HEAD^ --threshold 99`:
100% (94/94 executable changed lines) for the concurrency fix.
- `uv run --no-sync pre-commit run --from-ref HEAD^ --to-ref HEAD`:
passed, including formatting, file checks and private-key detection.
- `uv run --no-sync ty check raven/ops/connection_add.py
raven/ops/transport.py raven/cli/ops_connection_commands.py
raven/rpc/methods/machines.py`: passed.
- `uv run --no-sync lint-imports`: all 10 contracts passed.
- `uv run --no-sync python scripts/check_source_language.py
origin/main..HEAD`, `uv run --no-sync python
scripts/check_commit_messages.py origin/main..HEAD`, `make
check-large-files`, and `git diff --check origin/main...HEAD`: passed.
The original RPC failure/cancellation and CLI-abort reproductions failed
before the fix. Additional regressions cover the reverse completion
order, probes with competing passwords, temporary-secret scrubbing,
duplicate registration and failed registry writes. The complete rebased
source was compared with the original PR plus main, and the concurrency
fix retained its patch identity.
## Risk
- [x] Security impact considered: stored and temporary passwords are
owner-readable and scrubbed from tool output. Unknown SSH host keys are
accepted on the first connection, as before; the guides explain
verifying the host from a terminal first on an untrusted network.
Passwords shorter than six characters or containing CR/LF are rejected.
- [x] Backward compatibility considered: key registration remains the
default and `MachineRow.auth` is optional. Password publication and
cleanup now use file locks and atomic replacement; temporary probe files
are removed when the probe ends.
- [x] Rollback path is clear: revert this PR to restore the earlier
registration flow. Removing a machine deletes the password stored under
its id. Existing password rows require migration to key authentication
if reverting the feature.
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
Co-authored-by: Dizhan Xue <xuedizhan17@mails.ucas.ac.cn>
Co-authored-by: MiniMax (minimax-m3.1-flash-free) <noreply@minimax.io>
Co-authored-by: Codex <noreply@openai.com>
## Summary
Rejected tool calls now report the argument path, the expected shape and
what arrived, so the model can correct a misplaced field or a JSON
string instead of repeating the same call. Generic string casting
preserves objects and arrays for validation, and the kernel's
model-facing `ask_user` cast preserves option objects it cannot render
under its accepted field policy.
The validation and compatibility boundaries are:
- Generic validation does not execute schema-supplied `pattern`
expressions. Tool-specific validation, including the DAG parser's
patterns, remains responsible for those checks.
- Suggestions and misplaced-key searches share one budget across an
entire validation, including nested objects: 16 suggestion attempts, 256
candidate comparisons and 256 queued search nodes. Candidates are
limited to 32 names of at most 64 characters per object. Diagnostic
exhaustion suppresses optional hints, while validation continues to
report invalid arguments.
- Displayed keys, paths, individual errors and expected shapes are
bounded at 64, 160, 512 and 300 characters respectively. The rendered
diagnostic body is capped at 3,500 characters. Actual parameter lookup
uses the original keys. The registry keeps the error prefix used by
failure classification.
- Objects with nonempty `patternProperties` leave additional-property
casting and validation to the tool until those rules can be checked
together safely. Explicit properties and required fields are still
checked. This is partial schema support, not an implementation of
`patternProperties`. Array bounds apply only when they are nonnegative
integers other than booleans; malformed bounds remain unchecked.
- `image_search` retains its single-query fallback when `queries` is
empty and `query` is valid. A nonempty batch still wins. The DAG tool
normalizes aliases declared by its parser, including required-field
aliases, and rejects simultaneous alias and canonical names instead of
overwriting either. Node `skills` and `mcps` remain playbook-owned
fields, accepted by the graph parser and rejected at the model-facing
registry boundary.
- Research round-trip questions use the shared public `option_text`
renderer. A choice such as `{"label": "EU only", "id": 1}` reaches the
broker as `EU only`, and a description is retained. The kernel's
model-facing entry continues to reject unknown option fields. These are
separate acceptance policies.
- A closed MCP schema still rejects unknown fields; an open schema
forwards them. This compatibility change is deliberate. A server's
willingness to ignore fields does not change its declared schema.
`const`, `uniqueItems`, valid array bounds and additional-property
constraints without `patternProperties` remain enforced. `pattern`,
`patternProperties`, `anyOf`, `oneOf` and `format` are not fully
implemented by the generic validator. Complete bounded pattern support
and the research renderer's pre-existing fallback for objects with no
label or description remain follow-up work. The research renderer can
still discard unknown fields; this PR does not claim every product cast
is lossless.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
After resolving the test-file conflict with main, on Linux and Python
3.12.13:
```bash
uv run --frozen --no-sync pytest -q -n 0 \
tests/test_subagent_dag_core.py tests/test_subagent_dag_guard.py \
tests/test_subagent_dag_runner.py tests/test_subagent_dag_adjudication.py \
tests/test_subagent_dag_control_tools.py tests/test_subagent_dag_verdict.py \
tests/test_tool_params_cast.py tests/test_tool_registry_execute.py \
tests/test_ask_user_tool.py tests/test_mcp_client.py tests/test_agents_research_tools.py \
tests/test_agents_research_flow_ask_user_surface.py \
tests/test_agents_research_flow_ask_user.py tests/test_agent_tools_web_providers.py \
tests/test_security_untrusted_context.py tests/test_tool_admission.py \
tests/test_tool_refusal_continuation.py tests/test_l3_open_world.py --tb=short \
--cov=raven.agent.tools.params --cov=raven.agent.tools.ask_user \
--cov=raven.agent.tools.registry --cov=raven.agent.tools.web \
--cov=raven.agent.subagent.dag_tool --cov=research_flow.tools.ask_user \
--cov-branch --cov-report=json:coverage.json --cov-report=term
uv run --frozen --no-sync python scripts/coverage_gate.py \
--coverage-json coverage.json diff --base-ref origin/main --head HEAD --threshold 90
```
- 1629 passed, with 17 existing asyncio-marker warnings. HTTP(S) and ALL
proxy variables were unset. Coverage filenames above replace the
absolute local report paths used in the run; the diff gate used the
pinned main revision.
- Diff coverage: 98.08% (306/312 executable changed lines), above the
90% gate. This is coverage of the PR's changed production lines, not a
full-suite measurement.
- Conflict resolution preserves every top-level declaration from main
and all five additional PR regression functions. AST comparison reports
no duplicate declarations. All nine commits replayed; the only
range-diff change is the insertion context of the appended DAG tests.
- Through the real registry and graph parser, a synthetic branching
graph with `nodeSummary`, `promptTemplate` and `dependsOn` retains
`routes`, `select` and `when`, both as a node list and as JSON text.
Alias/canonical collisions and playbook-only `skills`/`mcps` remain
rejected. The probe uses a synthetic home and starts no workers.
- `uv run --frozen --no-sync ruff check raven evolver agents
plugins-dist tests scripts docs-site` and the matching `ruff format
--check`: pass.
- `uv run --frozen --no-sync ty check raven evolver agents plugins-dist
scripts`, `uv run --frozen --no-sync lint-imports` and `uv run --frozen
--no-sync deptry raven`: pass. Import contracts: 10 kept, 0 broken.
- Pre-commit on all changed files, `UV_NO_SYNC=1 make check-large-files
check-source-language COMMIT_RANGE=origin/main...HEAD`, and `uv run
--frozen --no-sync python scripts/check_commit_messages.py
origin/main..HEAD`: pass.
The full repository suite and native Windows checks run in CI for the
new head. The earlier head's full-suite counts, recorded-session replays
and native Windows review are not reused as measurements of this rebase.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed (no new
documentation in this conflict-resolution round)
## Risk
Closed schemas, including MCP schemas, and kernel `ask_user` option
objects with unknown fields have a stricter acceptance boundary. The
documented aliases and image-search fallback are preserved at their own
tool boundaries. Unsupported pattern rules remain delegated to tools;
this validator is not a complete JSON Schema implementation.
The budgets limit optional diagnostic work and rendered text, not the
total time required to validate arbitrarily large input. A missing-key
hint can be omitted when its search budget is exhausted. Bounded
previews can still contain a fragment of submitted text; length limits
are not a secret-redaction guarantee.
Four nonblocking re-review items remain outside this conflict-only
update: declared node aliases are not yet normalized at the replan
entry; some documentation still describes playbook-owned node fields as
model-facing; malformed MCP `properties: null` remains unsupported; and
the empty-batch fallback does not yet cover JSON-text empty batches or
`ppt_image_search`.
No new dependency, persisted state or migration. Rollback is a revert.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
The research, code, oncall and ppt agents keep prompt files in their
workspace that the model reads on every turn:
`agent_memory/profile/soul.md`, `agent_memory/profile/agent.md` and
`TOOLS.md`. They were written only when absent (`seed_once`), so after a
raven upgrade or a config change the model kept reading the text of the
first launch while the gates enforced the current release. A
Raven-Research install seeded before the reader layout still asked the
model for the `## Answer` / `## Findings` / `## Limitations` report
while its shape gate checked the reader layout.
These files are now generated output:
- `write_generated()` in `raven/config/product_render.py` rewrites a
product-owned file from the release and the rendered config on every
launch.
- An operator's own lines go in the sibling `*.local.md` file
(`agent_memory/profile/agent.local.md`, `soul.local.md`,
`TOOLS.local.md`) and are appended after the product text at the next
launch. They must be UTF-8: one in another encoding (an editor's legacy
code page, GBK for example) raises a decode error that names the
`*.local.md` and asks for UTF-8, rather than one naming the generated
file.
- A receipt beside each file (`.<name>.generated.sha256`) records
`<owner> <digest>` for the last text written. A file the caller's own
receipt lines do not name (edited in place, written by another product,
or left by an older release) is backed up to `<name>.bak-<time>-<pid>`
before it is replaced, and the log says which of those it is when the
receipt can tell. A backup is never readable by more accounts than the
original: on POSIX an owner-only copy; on Windows, where a new file
takes its folder's inherited ACL whatever mode it is created with, a
hard link to the file itself, so it keeps the file's security descriptor
and no bytes are written. A Windows volume that cannot hard-link refuses
the backup, and a failed backup leaves the file untouched. While the
target changes, the receipt names both texts, so a failure between the
two writes never leaves a file the next launch cannot recognise.
- `product_text=None` (raven-code's `CODE_CONDUCT=off`) removes only a
file this product wrote; an edited one, or another product's file and
receipt, is left alone.
- The launchers pass `adopt=True`, since their home is the product's own
ACP home, and refuse to start with the file named when a prompt cannot
be written. On a raven without `write_generated` they fall back to
seeding once and log that the file will not be refreshed.
- The ppt engine writes into whatever home its plugin is granted, which
can be a host's or another product's, so it passes `adopt=False`: it
replaces only a seat its own receipt, or the digest of a prompt it has
shipped, shows it wrote. A test fails when a ppt prompt changes without
its digest being added. It marks its identity written only once the
write lands and retries on the next turn otherwise. A seat that fails
does not stop the other seats; the host's template sync waits for the
retry, since it would fill the failed seat and a seat the engine did not
write is never replaced. A seat it leaves alone is logged at DEBUG, not
WARNING: in a host's home those are the host's own, every process, with
nothing to act on. The notice says how to hand a seat back (move the
lines into `*.local.md`, delete the file), which is what a seat edited
in Raven-PPT's own home before this release needs; the docs name that
exception.
- raven-code's earlier per-file receipts and legacy digests are still
honoured, so untouched copies are refreshed without a backup.
- `atomic_replace()` takes a `newline` argument so generated files stay
LF on every platform. It also removes its temp file when the replace
fails, and removes a temp file already present before it writes,
clearing the read-only attribute first: Windows refuses to replace a
read-only target once the temp file has taken its mode, and the
read-only temp file left behind used to fail every later launch even
after the target was made writable again.
- The temp file `atomic_replace()` writes is created no more open than
the target from its first byte. On Windows a new file takes its folder's
inherited ACL and `os.replace` (`MoveFileExW`) moves that descriptor
onto the target, so a prompt kept private in a folder other accounts may
read came back readable by them, `*.local.md` lines included. When the
target exists, the temp file is now made by `CreateFileW` with the
target's DACL as `GetFileSecurityW` reads it, and the save is refused
when that DACL cannot be read. On POSIX it is created with the target's
mode rather than the umask default, closing the span in which the new
text sat in a wider file until the chmod. This holds for every caller
that passes no explicit mode, `config.json` included. The Win32 bindings
behind it are declared once per process, behind a cache: a structure
defined per call left a new ctypes pointer type, about 6 KB, alive for
every save.
Docs: `agents/README.md` (the seed-once contract becomes "Regenerated
prompts", with rollback steps), `docs-site` agent integrations (en and
zh), `CONTEXT-MAP.md`, and `CHANGELOG.md` (an unreleased entry that
promised the old behaviour, plus a Fixed entry).
Tests whose meaning changed: seven existing tests asserted that an
edited prompt is never overwritten; they now assert it is backed up and
regenerated. The raven-code launcher test fixture now pins
`CODE_CONDUCT` and `CODE_CONDUCT_DISCIPLINE` to `on`: a deleted switch
fell back to the developer's `.env`, and two conduct tests on main
already failed with `CODE_CONDUCT_DISCIPLINE=off` for that reason.
Checked and deliberately not changed (documented in `agents/README.md`):
- The processes of one product (one per model binding) share these
files, so a launch can change what an older process still running reads
on its next turn. Closing that needs a per-process snapshot or
in-process injection of the prompt, which is a separate change.
- Backups are never deleted automatically.
- Host workspace templates (`USER.md`, `HEARTBEAT.md` and the rest) are
the user's files and stay write-if-missing.
- A file removed from a release is not removed from an installed
`~/.raven/agents` copy. Nothing loads such a leftover today: modes are
read by label, tools are imported by name, and no release has removed a
skill directory.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Run at the head of this branch, rebased on the current main:
- `uv run pytest -q`: 32739 passed, 17 failed, 147 skipped, 2 xfailed.
The same 17 test IDs fail on the current main in a clean worktree with
the same interpreter and the same fetched tokenizer dictionary (proxy
redaction, tokenizer data, network-safety resolution, install script,
document converters, node runtime, trajectory time zone); none is
introduced here.
- `uv run pytest tests/test_agents_code_launcher.py -q` with
`CODE_CONDUCT` and `CODE_CONDUCT_DISCIPLINE` each set to `off` in the
environment, alone and together: 79 passed in all four runs.
- `make lint-python lint-imports lint-types lint-deps`: all pass, 10
import contracts kept, no dependency issues.
- `scripts/check_commit_messages.py`, `scripts/check_source_language.py`
and `scripts/check_large_files.py` over `origin/main..HEAD`, and `git
diff --check`: pass.
- Each fix was reverted on its own and its test went red: the receipt
written after the target, a failed target write, the backup mode, the
ppt `adopt=False` guard, receipts without an owner, an undeletable
earlier receipt, the `*.local.md` read-back from the assembled system
prompt, the temp file a failed replace leaves behind, and the temp
file's mode while it holds the new text.
- Windows review findings:
`test_a_windows_backup_is_the_edited_file_itself_so_its_acl_comes_with_it`
and `test_a_windows_backup_the_volume_cannot_link_is_refused_not_copied`
force the link path on Linux;
`test_a_failed_replace_takes_its_tmp_with_it` and
`test_a_read_only_tmp_a_dead_writer_left_does_not_block_the_replace`
cover the temp file on every platform;
`test_the_tmp_is_never_more_open_than_the_target_while_it_holds_the_new_bytes`
pins the POSIX mode from creation;
`test_a_read_only_prompt_regenerates_once_it_is_writable_again`
(read-only retry) and
`test_a_private_windows_prompt_keeps_its_own_dacl_when_regenerated_and_backed_up`
(a private prompt in a folder every local user may read keeps its own
DACL through regeneration and backup, read back with `icacls /save`) run
on Windows only.
- The `Windows ACP stdio` CI job gains a step that runs
`tests/test_config_product_render.py` and the two temp-file tests
natively. On the Windows runner: 158 passed, 2 skipped (the two
POSIX-mode tests), the DACL, read-only retry and hard-link backup tests
among the passes.
- Diff coverage over `raven/` with the related suites: 94.12%, above the
90% gate.
- Second-round review findings, each test red without its fix:
`test_an_addendum_that_is_not_utf8_is_named_and_nothing_is_written`,
`test_a_local_file_that_is_not_utf8_is_named_when_the_launch_stops` and
`test_an_addendum_that_is_not_utf8_names_itself_and_holds_back_no_other_seat`
(the decode error names the addendum; the ppt engine writes the other
seats and holds the sync);
`test_a_hosts_own_seats_are_left_alone_without_a_warning_in_every_process`
and `test_a_seat_left_alone_says_how_to_hand_it_back` (DEBUG level, and
the notice's instructions);
`test_the_windows_bindings_are_declared_once_not_per_save` (Win32
stand-ins on Linux, two saves load each DLL once).
Windows is covered by the CI step above, not by a local run. The CRLF
fold of an older copy is reasoned, not run. `npx commitlint` is not
installed on the machine this was run on; the Python commit check above
was run instead.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- User-visible: on the first launch after upgrading, each agent rewrites
its prompt files. A file edited in place, or left by an older release
without a receipt, is copied to `<name>.bak-*` and the launcher log
names the copy; an in-place edit stops taking effect until its lines are
moved into `*.local.md`. A `*.local.md` that is not UTF-8 stops the
launch with the file named. In Raven-PPT's own home a seat edited before
this release keeps the edit, and its `*.local.md` is not applied, until
the seat is deleted. A Raven-Research install seeded before the reader
layout switches to it at that launch.
- Security: a backup is never readable by more accounts than the file it
keeps (an owner-only copy on POSIX, a hard link keeping the file's ACL
on Windows), and a replaced file keeps its own mode, and on Windows its
DACL, from the temp file's first byte; receipts hold product names and
digests only; `*.local.md` is operator-owned and carries the same trust
as editing `agent.md` did before.
- Compatibility: a launcher running on a raven without `write_generated`
seeds once and logs it; the ppt engine on such a raven keeps
write-if-missing. On a Windows volume that cannot hard-link (FAT32,
exFAT, some network shares), an edited prompt file stops the launch with
the file named, until its lines move to `*.local.md` and the file is
deleted. On Windows, a save through `atomic_replace()` whose target's
DACL cannot be read is refused rather than made with the folder's ACL.
- Rollback: revert this change, then stop the product's processes,
delete each generated file whose `.<name>.generated.sha256` receipt
still names its current text, and relaunch so the older code seeds its
own. `*.local.md` files, backups and edited files are left as they are.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: userName20260323 <270284818+userName20260323@users.noreply.github.com>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
Raven-Code reports Python syntax errors after file edits but misses
unresolved names and equivalent feedback after shell edits. Add advisory
Pyflakes F821/F822/F823 checks to the existing tool result; optional
F401 notices remain off by default. No additional model call or code
execution is involved.
```text
write_file / edit_file
-> inspect final source, compare with a baseline that can be read and analyzed
-> retain syntax warnings; suppress existing name findings
exec
-> require checkpoint visibility for the working directory
-> read the changed files from the host's write record for the command
-> ask visibility in batches of 256, select at most 8, check up to 4 concurrently
-> append ordered diagnostics, preserving exit status and file metadata
```
Existing syntax failures remain visible after unrelated edits and
identical rewrites. A baseline that cannot be read, parsed or analyzed
is marked unknown; overwriting non-UTF-8 source still checks the known
replacement. Source nested too deeply for the parser or checker, and a
changed file that cannot be read, report diagnostics unavailable for
that file rather than passing as clean. Every check reads a file as the
bytes Python runs: text a write or edit stores is checked as its UTF-8
bytes, the content it replaced included, and a file from disk as its
bytes, each decoded as Python decodes source, by its coding declaration
or as UTF-8. Bytes that do not decode are reported as a syntax error at
the line where decoding stops, so a declaration the written text cannot
satisfy is reported however the file was changed. Noqa comments are read
as Ruff reads them, including after other comment directives and never
inside string literals: a file-level `ruff: noqa` / `flake8: noqa`
counts only on a line of its own, and a marker counts only when codes
follow its colon or, with no colon, whitespace, another comment or the
end of the comment follows it. Unlike Ruff, which takes the first
directive in a comment, every directive in it counts. The seeded tool
guide gives the syntax note's own advice. With no checkpoint or no
visibility verdict, exec diagnostics do not inspect changed file
contents; direct file checks remain available.
Pyflakes is imported when the tool face loads, not by whichever check
first needs it: imported lazily, its cold import fell inside that
check's one-second wait, and on a slow Windows runner the one test that
paid it reported diagnostics unavailable for a plain syntax error.
Private workers bound reads and checks to four active jobs per process.
Saturated capacity rejects new work without queuing, and
timeout/cancellation retains each slot until the actual work finishes.
Name checks are capped at 256 KiB of source and the syntax check at 2
MiB, and a check skipped for size says so in one line. Findings are
capped at eight per file, and exec diagnostic text at 6,000 characters
plus omission notices.
Runtime changes stay inside the Raven-Code code-flow plugin, except for
one fix to `CheckpointService.trackable`, the visibility verdict that
exec diagnostics and the host's exec write record both rely on. On
macOS, git precomposes a file name it reads off the disk before matching
an ignore rule, but takes the paths `trackable` sends to `git
check-ignore --stdin` as written. A file stored with a decomposed (NFD)
name under a `.gitignore` rule written precomposed (NFC) is therefore
left out of the checkpoint, yet main vouches for it, so the write
record's diff carries its text, and exec diagnostics would quote its
source lines to the model. Nor is git's precomposition NFC: it composes
only neighbouring characters, by Unicode 3.2's table, and reorders
nothing, so a name whose combining marks are out of canonical order
comes out as neither the name as given nor its NFC. `trackable` now asks
about each name as given, as NFC and in git's macOS spelling, and
withholds it when any spelling is ignored. Other shared
file/shell/snapshot implementations are unchanged.
Raven-Code has no separate dependency manifest, so Pyflakes uses the
existing root dependencies. It is the only added package; uv normalized
existing lockfile markers without changing other package versions.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- **Before:** on main, Raven-Code's file tools report Python syntax
errors only, and its exec reports nothing about the Python files a
command changed. On macOS, main's `CheckpointService.trackable` vouches
for a file stored as `secret_cafe` + U+0301 + `.py` under the rule
`secret_caf` + U+00E9 + `.py`: the user's own git ignores it and the
checkpoint's staged tree leaves it out, yet its text reaches the exec
write record's stored diff.
- **After:** on macOS 26.6.2 / arm64 with Apple Git 2.54.0, the command
below passes 364 tests on Python 3.12.13 and on 3.14.6. The full default
suite on 3.12.13 has 32283 passed, 169 skipped, 20 failed and 3 errors
over 22 test ids: 21 of them also fail on the exact base in the same
environment, and the other, a remote process-tree cancel test that
missed its deadline under the suite's load, passes when run alone. Tests
cover actual worker overlap, retained capacity after
timeout/cancellation, host-tool isolation, hidden-file quotas,
visibility batching through the host's write-record wiring, baseline
handling, parser-limit failures, the size bounds and their skip notes,
undecodable bytes placed where decoding stops, coding declarations in
written and edited text, the baseline read staying on a worker, the
checker loaded with its module, the file each unavailable note names,
comment directives and their marker boundary, the tool guide's agreement
with the syntax note, portable commands in paths with spaces/non-ASCII
characters, and the checkpoint's verdict on decomposed names and on
names git spells as neither given nor NFC, held against its own staged
tree. Removing any of the three spellings from the query fails the cases
that pin it, as does removing the marker boundary, the parser-limit
report, the unknown-baseline handling, the syntax check past the
name-check bound and the decoding report, checking written text as its
stored bytes, the worker around the baseline read, loading the checker
with its module, or the file name in an unavailable note; restoring the
guide's earlier advice fails its agreement test. git's macOS spelling is
what libiconv's UTF-8-MAC conversion returns, which git precomposes
with: composing neighbours by Unicode 3.2's table reproduced it for all
281,928 names built from every decomposable character's decomposition
(reordered, partly composed, or with a mark added), and across 784,220
further mixed names and pairs no name was spelled outside the three
asked; the same held under Python 3.13 and 3.14. The decomposed-name
check asserts the macOS outcome only where git precomposes names, so it
also passes with `core.precomposeunicode = false` set through
`GIT_CONFIG_GLOBAL`. Across 102 noqa comment variants the reported lines
match Ruff 0.15.12, except the three that hold several directives in one
comment. Through the real `AgentLoop`, code-flow tool face,
`CodeExecutor` and checkpoint, with the working directory under `/tmp`,
under `$TMPDIR` and in a path with spaces and CJK characters, exec
diagnostics report created, modified and decomposed-name files, follow
`working_dir`, report an undecodable file at the line where decoding
stops, a syntax error past 256 KiB and a skip past 2 MiB, and withhold
`.gitignore`d files, including decomposed names and names git spells as
neither given nor NFC; across repeated runs on both interpreters, a file
near the 256 KiB cap is checked in 52-135 ms (117-128 ms against a
baseline), the syntax of a file near 2 MiB in 318-371 ms, and 600
ignored files plus one visible file take 73-90 ms with the event loop
held at most 20 ms. At this head CI passes the unit suite on
Linux/Python 3.12 (32619 tests over four shards), and its two Windows
steps pass the diagnostic files on native Windows/Python 3.13: 122
file/worker tests, and 27 exec diagnostic tests with 17 pre-existing
executor tests deselected; the symlink fixture skips only where the host
cannot create links.
```sh
env -u SERPER_API_KEY -u RAVEN_MIRRORED_SERPER_API_KEY uv run --no-sync pytest tests/test_agents_code_diagnostic_workers.py tests/test_agents_code_tools_plugin.py tests/test_agents_code_flow_exec.py tests/test_agents_code_flow_plugin.py tests/test_agents_code_flow_read_state.py tests/test_agents_code_launcher.py tests/test_workdir_snapshot.py tests/test_shell_command_writes.py tests/test_runtime_checkpoint.py tests/test_trajectory_upload.py::test_blocked_upload_hits_the_deadline -o addopts= -q --tb=short --maxfail=3
uv run --no-sync ruff check raven/agent/loop/checkpoint.py agents/raven-code/plugins/code-flow/code_flow/tools agents/raven-code/plugins/code-flow/code_flow/config.py tests/test_runtime_checkpoint.py tests/test_agents_code_flow_exec.py tests/test_agents_code_tools_plugin.py tests/test_agents_code_diagnostic_workers.py
uv run --no-sync ty check raven/agent/loop/checkpoint.py agents/raven-code/plugins/code-flow/code_flow/tools agents/raven-code/plugins/code-flow/code_flow/config.py
uv run --no-sync lint-imports
uv run --no-sync ruff format --check raven/agent/loop/checkpoint.py agents/raven-code/plugins/code-flow/code_flow/tools agents/raven-code/plugins/code-flow/code_flow/config.py tests/test_runtime_checkpoint.py tests/test_agents_code_flow_exec.py tests/test_agents_code_tools_plugin.py
```
Native Windows CI commands:
```sh
uv run --frozen --python 3.13 --no-sync pytest tests/test_agents_code_diagnostic_workers.py tests/test_agents_code_tools_plugin.py -q -n 0 --tb=short
uv run --frozen --python 3.13 --no-sync pytest tests/test_agents_code_flow_exec.py -k test_exec_ -q -n 0 --tb=short
```
Ruff, format and type checks passed; all 10 import contracts kept; the
commit-message, large-file and source-language checks pass over the
branch. The launcher tests unset inherited search API keys to keep the
expected tool list deterministic.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
Scope: Raven-Code's enabled code-flow tool face; installing Pyflakes
does not activate checks in other agents. The change is reversible and
never fixes/removes code or rolls back edits. Static diagnostics can
need judgment for dynamic names, target Python versions, and project
lint configuration; only explicit noqa directives are honored. Passing
diagnostics do not replace tests.
The `trackable` fix reaches every exec write record, not only
Raven-Code: a file whose name, as given, as NFC or in git's macOS
spelling, matches an ignore rule keeps its counts and loses its diff and
removal body. Where git matches another of those spellings, as off macOS
for a decomposed name under a precomposed rule, the checkpoint stores
the file but it is still withheld; its counts remain.
Exec diagnostics now require an active checkpoint. Noninteractive runs
using the default interactive checkpoint policy must explicitly enable
checkpoints to receive this feedback. Visibility is checked in batches
of up to 256 files and stops once eight visible files are found; each
batch holds the event loop while the host resolves its paths, about 130
ms for a full batch on native Windows. Each file-check wait is one
second, and post-command diagnostics have a three-second wait budget;
past it, or when they fail as a whole, they are dropped and the
command's result is kept. These are caller budgets, not hard I/O
deadlines: running OS reads and inherited synchronous host callbacks
cannot be forcibly interrupted. Private worker capacity remains bounded.
Between 256 KiB and 2 MiB only syntax is checked: near 2 MiB that took
0.3-0.4 s and about 190 MiB here, up to four checks run at once, and on
slower hardware such a check can outlast the one-second wait and report
diagnostics unavailable. Python's GIL means concurrency does not promise
a CPU speedup.
Windows CI exercises the diagnostics layer with the real native
DirectExecutor. The existing CodeExecutor environment probe uses POSIX
quoting and already fails on Windows at the base; this PR neither
changes that probe nor claims end-to-end compatibility for it. Symlink
setup is skipped only if the host cannot create the fixture.
Disable `pythonLint` for syntax-only feedback, `execPythonDiagnostics`
for no post-command checks, or `pythonSyntaxNote` for no diagnostics,
under `plugins.config["code-flow"].tools`. The PR can also be reverted
as a unit.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Dizhan Xue <xuedizhan17@mails.ucas.ac.cn>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
Connect the coding agents Mirasim runs as Raven ACP sub-agents, with one
bundled preset per agent and no separate adapter download.
- Serve Claude Code, Codex, Kimi Code, Antigravity, Qwen Code, Grok
Build, DSH, Pi and ZCode CLI through `mirasim ui-cli`. The adapter
runs on Raven's interpreter, so a Mirasim preset is not offered on a
registered machine, and a stored row whose interpreter is gone is
pointed at the running one when the config is next read. It withholds
session MCP because ui-cli does not accept per-session servers. The
boot capability backfill asks Mirasim once which agents it has
installed and handshakes only those.
- Read model and effort choices from Mirasim. Offer the own models of
Claude Code, Codex, Kimi Code and ZCode CLI on both their own-account
and Mirasim platform routes. Persist conversation bindings and switch
routes before continued turns. A menu read that fails is tried again
after a short pause rather than kept for the cached copy's lifetime,
an effort the menus in hand do not offer is read again before it is
refused, and a failed menu read still reports the agents installed
since the last one. A connect or test whose handshake could not read
the menus keeps the ones already measured, and connecting an agent
with a model refuses one its measured menu does not offer, as editing
one already did.
- Retain the last model catalog when a refresh fails. Deleting a session
prevents later writes, prompts, loads and route switches, waits for an
already-running store write, and does not wait for unrelated catalog
work. A turn, and its cancel, uses the catalog in hand instead of
queueing behind another session's read.
- Relay questions and tool approvals through ACP. Content returned by
another agent retains that agent's redaction policy, including values
matching Raven's configured credentials. The rule covers Mirasim,
shared sub-agent records and announcements, delegated tool results,
A2A replies, logs, main-agent context, live ACP updates and session
replay. Provenance is decided per result: a tool's declaration admits
it to carrying another agent's content, and each result that does
claims it, so a delegating tool's own errors, receipts and status
lines stay Raven's text under the local scrub, and no result can claim
provenance its tool never declared. Forwarding through `tool_call`
carries a result whole for every tool, so a refusal reached that way
ends the turn as a direct call does. The contract surface version is
incremented for the added provenance fields. Local tool-result
protections, outbound credential handling, permission checks and
untrusted-content fencing retain their existing roles.
- Group unconfigured Mirasim presets into one card. Connect each member
with its selected model in one write. Missing members open the
existing installation and recheck flow, and a member whose handshake
was refused for want of a sign-in is named in the drawer as it is on
its card. A family whose members sit in two sections of the agents
page draws one card in each. Narrow drawers keep the agent name and
place the model and action on a second row.
- Guard command processes and clean up their descendants on
cancellation, including ones a tool starts in a session of its own
while the agent ignores SIGTERM: on Linux the guard adopts them as a
child subreaper, and the process tree is read again before SIGKILL. A
guard that outlasts its drain no longer replaces the command's own
error with a shutdown traceback. Stage oversized prompts within the
full Windows command-line budget, counting the venv launcher's second
launch, refuse a `mirasim` that resolves to a `.bat` or `.cmd` shim,
and preserve percent escapes and UNC authorities in file attachments.
The guard starts without the ACP package, polls its command's exit
quickly at first and then slowly, and the adapter's stderr log carries
no local variables.
- Share the existing ACP stdin reader with the adapter, and update the
integration docs, domain vocabulary, translations and agent-mark
attribution.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Rebased onto current main and reran validation on Linux with Python
3.12.13 and Node 22.23.2. The isolated interpreter resolves this
checkout even when a subprocess clears PYTHONPATH. Existing dependencies
were reused without changing their declarations or lockfile. In the
commands below, `$CHECKS` denotes the temporary result directory used
for the run. Both Python selections use the same
`COVERAGE_FILE=$CHECKS/post-rebase.coverage`.
```sh
uv run --frozen --no-sync pytest tests/test_agent_loop_*.py tests/test_acp_mirasim_*.py tests/test_tool_registry_*.py tests/test_subagent_acp*.py tests/test_subagent_activity.py tests/test_subagent_history.py tests/test_subagent_manager.py tests/test_subagent_probe_state.py tests/test_security_untrusted_context.py tests/test_tool_admission.py tests/test_tool_search.py tests/test_cli_log_file.py tests/test_acp_journal.py tests/test_a2a_client_tool.py tests/test_subagent_mirasim.py tests/test_subagent_probe.py tests/test_subagent_third_party.py tests/test_ui_agent_marks.py tests/test_acp_replay.py tests/test_acp_updates.py tests/test_rpc_console.py tests/test_rpc_system.py -n 0 -x -q --tb=short --show-capture=no --cov=raven --cov-branch --cov-report=json:$CHECKS/post-rebase-coverage.json --cov-report=xml:$CHECKS/post-rebase-coverage.xml --junitxml=$CHECKS/post-rebase-python.xml
# 2871 passed
uv run --frozen --no-sync pytest tests/test_contracts_*.py tests/test_tool_admission.py tests/test_tool_registry_execute.py tests/test_security_untrusted_context.py tests/test_config_loader.py tests/test_raven_config_tool.py tests/test_rpc_subagents.py tests/test_subagent_name_vocabulary.py tests/test_tool_refusal_continuation.py -n 0 -q --tb=short --show-capture=no --cov=raven --cov-branch --cov-append --cov-report=json:$CHECKS/post-rebase-coverage.json --cov-report=xml:$CHECKS/post-rebase-coverage.xml
# 487 passed, 1 skipped (POSIX directory permissions are not enforced for root)
uv run --frozen --no-sync python scripts/coverage_gate.py --coverage-json $CHECKS/post-rebase-coverage.json diff --base-ref origin/main --head HEAD --threshold 90
# 93.33%, 1594/1708 executable changed lines; passed
```
The full Python suite, `uv run --frozen --python 3.12 --all-extras
pytest -q`: 9 failed, 32315 passed, 176 skipped, 2 xfailed. Each failing
id is then run by id against a clean archive of the merge base, through
the same interpreter and extras and with the imported `raven` checked to
resolve inside the archive; every id that fails here also fails there.
The catalog-only failure and resumed-session deletion regressions failed
before their fixes. Additional tests exercise deletion during catalog
reads, store writes and route lookups. The content-policy tests failed
against the former redaction behavior and now check exact content
through direct calls, tool_call, the main provider, recorded frames,
persisted transcripts and ACP replay. Local file reads and outgoing
credential records remain covered by controls.
In ui-web:
```sh
npm test -- --no-file-parallelism
# 250 files, 3977 tests passed
npm run gen:check
npm run type-check
npm run lint
npm run build
# passed; lint has four warnings in unchanged files
```
Chromium checks used the actual page and styles with synthetic agent
rows. Model selection travels in the connect request; Escape closes only
the picker; missing members reach the download link and Check again. At
390px and 320px the name columns measure 252px and 182px, respectively,
with no horizontal overflow in the drawer. No page errors were reported.
```sh
make check-commits check-large-files check-source-language
# passed
npm run lint:i18n --prefix ui-tui
npm run lint:rpc --prefix ui-tui
# passed
uv run --frozen --no-sync python -m pre_commit run --from-ref origin/main --to-ref HEAD
```
The full-PR pre-commit run passes except prettier (ui-tui), which flags
`src/components/newInstancePicker.tsx` and
`src/components/subagentsHub.tsx`. Both files are byte-identical to
main; running the formatter against their main contents fails too. The
fixes do not touch either file. Commit-scoped hooks for the new changes
pass. Ruff check and format, ty on changed production files, all ten
import contracts, and whitespace checks pass. Every replayed commit
retains its patch, and the PR title and body pass the repository's ASCII
and commit-message grammar checks.
The earlier native Windows verification covers prompt launch limits and
file-URI conversions. This follow-up has no new native Windows, real SMB
or live vendor/provider run.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
Credential authorization and scope belong at the point where access is
granted. Redacting a later reply cannot revoke access the receiving
agent already has. Under this product policy, Raven preserves returned
content unchanged and leaves redaction decisions to the sending agent.
Credentials an agent includes in its reply can therefore remain in
Raven's retained logs and transcripts.
Agent-returned content is preserved according to the sender's policy
across all supported delegation paths. The adapter returns each reply
when the turn settles rather than streaming it. Short prompts use
command-line arguments; oversized prompts use temporary attachments.
Connecting an agent probes it: with a model chosen, on that model's own
route, so the pick a connect carries is proved before the row is stored;
with none, on the agent's default. Compatibility was originally measured
against Mirasim 0.0.465; older CLI versions have not been verified.
A stored Mirasim row whose interpreter no longer exists is rewritten in
the config file, once, by the first Raven to read the config after that
interpreter is gone. A row naming another interpreter that still exists
is left as written, so two installs reading one config do not rewrite it
back and forth.
Rollback is a revert. Configured Mirasim rows then need removal because
their bundled adapter is no longer present, and until they are removed
Raven refuses to load the config at all: an unknown preset name fails
validation, so the host does not start and the file has to be edited by
hand.
## Related Issues
N/A
## Summary
A page of `read_file` is cut to whole lines within its 128k-character
budget. A file whose first line is over the budget by itself (a minified
script, a one-line JSON, a long CSV row) left nothing within it: the
page came back empty, and its footer said to continue at the very line
it had just not shown, so the reader went round for ever. Measured
before the change: `(Showing lines 1-0 of 1. Use offset=1 to continue.)`
for a single 200k-character line, and `(Showing lines 2-1 of 3. Use
offset=2 to continue.)` once a shorter first line had filled page one.
Such a line is now shown by its head, as much as the budget holds,
followed by a note that says how long the line is, how much of it is
shown, and that `offset` moves by lines and cannot reach the rest:
`grep` tells whether a piece is in it, and a shell command that cuts by
bytes (such as `cut -c`) shows another stretch. The paging footer then
points at the next line, so paging moves on. A first line that just fits
(the line break the budget counts put it over) is shown whole, without a
note. Pages that fit are unchanged.
The node runs the same tool for a file on a registered machine, so the
remote read reads the same; one of the new tests goes through the real
node behind the stand-in ssh.
Raven-Code's `read_file` (the code-flow plugin) cuts every line to 2000
characters. It had its own way round the empty page: whenever trunk
answered with no numbered line it re-read the whole file itself, and
otherwise it cut the lines after trunk had counted the page, so a dozen
10k-character lines filled a page. Trunk's read now offers a hook,
`_cut_line`, applied to each line before the page's budget counts it
(trunk's own is a no-op); the plugin cuts on it, so minified lines share
a page, each cut once, and its whole-file re-read is removed. Its cut
after the read now runs only for a page a registered machine's node
answered (the node runs trunk's tool, without the plugin's hook); a page
read here was cut on the hook and is not looked at again. The first head
told a cut line apart by its ending, so a line whose own text ends like
the mark came back whole (both reviewers reproduced it); whether a line
was cut is now decided by where the read ran, never by its text.
Changed: `raven/agent/tools/filesystem.py` (the trim loop and the hook
in `ReadFileTool`),
`agents/raven-code/plugins/code-flow/code_flow/tools/filesystem.py` (the
plugin's read), tests in `tests/test_filesystem_tools.py`,
`tests/test_remote_file_tools.py` and
`tests/test_agents_code_tools_plugin.py`.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- The six new tests fail on `origin/main` (the four about the page with
the empty pages quoted above; the two about the hook with a dozen lines
per page) and pass after the change: `pytest
tests/test_filesystem_tools.py tests/test_remote_file_tools.py
tests/test_agents_code_tools_plugin.py -k "longer_than_a_page or
just_fills_the_page or going_round or cut_per_line or minified_lines"`.
- Second commit:
`test_a_line_whose_own_text_ends_like_the_mark_is_cut_like_any_other`
fails on the first head (the line comes back whole) and passes now;
`test_a_page_a_registered_machine_s_node_answered_is_cut_after_the_read`
pins the pass after the read for a page a node answered, through a
stand-in pool.
- `pytest tests/test_agents_code_tools_plugin.py
tests/test_filesystem_tools.py tests/test_remote_file_tools.py
tests/test_node_server.py tests/test_read_file_image.py
tests/test_tools_workdir.py tests/test_tool_registry_execute.py -n 4`:
356 passed.
- `scripts/coverage_gate.py diff --base-ref origin/main`: 100% of the 11
changed executable lines.
- `ruff check`, `ruff format --check`, `ty check` on both changed
modules: clean.
- `scripts/check_commit_messages.py`,
`scripts/check_source_language.py`, `scripts/check_large_files.py` over
`origin/main..HEAD`: clean.
- Full suite (`pytest -n 6`), run again at the second commit: 31623
passed, 233 skipped; the 3 failures are the ones main has on this
machine (a LibreOffice-less host, two simulation cases), unrelated to
this change.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed (checked
CONTEXT.md, docs-site and the plugin's own text: nothing describes the
page footer or the plugin's cut; both tools' descriptions still hold)
## Risk
- [x] Security impact considered: nothing new is read, and the note
names no path.
- [x] Backward compatibility considered: a page that fits is unchanged,
and the existing paging tests still hold; the hook is a no-op unless a
subclass overrides it. In Raven-Code the page of a file with minified
lines holds more lines than before (the cut lands before the budget) and
the one mark reads as it did.
- [x] Rollback path is clear for risky changes: revert the one commit.
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
Adds `everos-cloud-memory`, a separately distributed memory plugin for
EverOS Cloud, and wires the host so a second memory plugin is a
first-class choice.
The plugin (`plugins-dist/everos-cloud-memory`) is a thin REST client
over httpx: one API key (the config slice
`plugins.config.everos-cloud-memory.api_key`, or
`EVEROS_CLOUD_API_KEY`), owner ids from the host's `ServiceLocator`
(never from the slice), every add in `agent` mode, and a flush only when
a caller marks the conversation over (`metadata.flush` /
`metadata.is_final`: the sub-agent handoff and the importer's final
batch) and once at stop. It ships its own onboard screen (env or on-file
key used without a prompt; 401 / 403 / unreachable get their own
sentences with Re-enter or Skip), `delete` answers False (the cloud
deletes by scope, nothing calls it), and `health()` classifies seven
answers for `raven doctor` and the settings card.
Host changes, each guarded so `memory.backend` `everos` and `null`
behave exactly as before:
- `raven onboard` step 4 asks "Which memory backend?" when more than one
plugin contributes a screen (preselects the current backend, `Off`
clears it, cancel exits 1 and writes nothing); with one plugin the step
is byte-identical to today.
- The memory page reads whichever backend `memory.backend` names: the
cloud slice's key goes out as a Bearer header and the `/health` probe is
skipped for the cloud; a missing distribution is named in the page's
note.
- `settings.everos` reports `reason: "other_backend"` for any non-EverOS
backend, so the Model page hides the three EverOS-only roles (embedding
stays: knowledge bases use that pin); `settings.everosSet` refuses those
three sections for another backend; `settings.set` admits
`plugins.config.<id>.<field>` against the plugin's manifest through the
same admission door channels use; new `settings.everosCloud` feeds the
card (key source, endpoint, health).
- Provider-key and main-model saves no longer restart the local EverOS
when another backend is active.
- ui-web: an EverOS Cloud card (status chip, key row, endpoint) and the
`settings.everosCloud` data behind it. No page mounts the card: it drew
on Model settings until the owner ruled that a memory backend's endpoint
and credential answer neither question that page asks, and where it
belongs is the Memory section's to say once that section has a design.
Until then the key is entered through `raven onboard` or
`EVEROS_CLOUD_API_KEY`. The fixture gate pins the four optional fields
the offline library never sends.
- Gates: the plugin boundary test scans both memory plugins, coverage
and the release workflow build the second wheel, deptry's ignore list
names the plugin beside `raven_everos`, and a conftest fixture keeps the
second plugin out of entry-point discovery for the existing onboarding
tests (they describe a one-plugin install).
A second topic rides along, because it is what makes the hosted backend
reachable from an agent product at all. Every product under `agents/`
pinned its memory at the stock EverOS address and only `raven-design`
read the host's, so the other four addressed whatever answered on 18791
-- the wizard moves a managed server when the port is taken, and a
server the user runs themselves is wherever they put it.
`inherit_memory_backend` in `raven/config/product_render.py` now carries
`memory.backend`, the endpoint, and (only when the product holds none
itself) the credential from the host into every render, beside the host
denials and plugin opt-outs that already travel there; `raven-design`'s
private copy is deleted and the five product configs stop naming an
address. Identity never travels, which is what keeps five products apart
inside one store. `memory.backend: null` travels like any other value,
because that null is how an operator turns long-term memory off and a
product that kept writing would be the one surface ignoring them; the
product's own default stands only when the host carries no key at all.
Which store memories live in is not a product's choice either: the host
reads a sub-agent's memories back through its own backend, so a product
writing anywhere else left that record empty with nothing reporting it.
`owned` is forced off whenever the local backend is in force, because a
product infers ownership from a slice naming no root -- the shape all
five ship -- and so answered a host that was merely not serving by
starting a second server against a root of its own, stranding every
memory written so far.
Decisions worth a reviewer's eye: the fake cloud
(`tests/_everos_cloud_fake.py`) honours or refuses every field the
backend can send and serves both an in-process transport and an HTTP
face for the real-host acceptance; the live tests
(`tests/integration/test_everos_cloud_real_cloud.py`) skip without
`EVEROS_CLOUD_API_KEY`; run with a real key on 2026-10-09 all six pass
against api.evermind.ai (round trip, get by session, empty flush, 401
wording, probe with and without a key, and extraction without a flush
within two minutes), so the documentation and the service agree on
everything the plugin sends. Design, acceptance cases and plan are under
`docs/specs/2026-10-08-everos-cloud-memory-*.md` and `docs/plans/`.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
Rebased onto main `182dacac0` on 2026-10-13. What that rebase and the
four commits on top were verified with:
- Full suite, `uv run --frozen --python 3.12 --extra dev pytest -q` ->
**29748 passed, 8 failed** in 4m10s. All eight fail identically with
these four commits' sources reverted in-tree at the same base, so none
of them is this branch's: the two `test_the_products_tool_face_*` cases
in the code and oncall launchers (an extra `web_search` in the visible
tool set), `test_agent_loop_token_budget`,
`test_rpc_files::test_a_host_without_libreoffice_says_so`,
`test_ppt_engine_image_search`, `test_shell_background`, and the two
`test_simulation_*` cases.
- Real-host before and after for the inheritance, driving the launcher
the host spawns (`agents/raven-research/run.py`) against an isolated
`RAVEN_HOME` whose EverOS address is `19701`, not the stock port.
Before: the product rendered `base_url: http://localhost:18791` with no
`owned` key, ignored the host, and started an EverOS of its own -- an
orphaned `everos server start --root <its own state root>/everos`
holding 18791, which is the stranding this change exists to stop. After:
it rendered `{"base_url": "http://localhost:19701", "owned": false}` and
said so itself, "the EverOS you manage is not running at
http://localhost:19701 ... Raven does not start or stop it", with `ps`
and `lsof` confirming nothing was started. On the cloud the product
rendered `memory.backend: everos-cloud` with the host's key and left the
out-of-force local slice untouched, and `raven doctor` over that
rendered config answered `everos-cloud: ok https://api.evermind.ai`, so
the credential reached the service. Identity stayed `raven-research-ng`
throughout, and a fingerprint of the operator's own EverOS root was
identical before and after.
- The first CI round on this head found one that the local gates did
not: `tests/test_import_cycle_budget.py`. `inherit_memory_backend` read
the backend-to-distribution pairing from `raven.core.plugin_stack`, and
that edge from `raven.config` into `raven.core` -- which imports
`raven.config` back -- took mutual pairs from 13 to 14 and packages
inside a cycle from 18 to 22. `make lint-imports` keeps ten contracts
and none of them covers that pair, so it was green throughout. The
pairing now lives in `raven/config/raven.py` beside the two fields it
joins (`MemoryConfig.backend` names a contribution,
`PluginsConfig.config` is keyed by the distribution), which `raven.core`
may import and which imports nothing back; `plugin_stack` re-exports the
two names its own callers read from it. An intermediate commit put it in
`raven.contracts` instead, which broke the cycle but took the papers
ceiling from 3700 to 3719 lines -- `tests/test_kernel_budget.py` says a
new paper is a reviewed change to that ceiling, so it moved again rather
than raising it.
- The review round on this head raised one non-blocking finding, fixed
rather than carried forward: the inheritance read `memory.backend` with
`.get()`, which collapses an explicit `null` into an absent key, so a
host with long-term memory off left every packaged agent on its own
shipped backend and still writing. Reproduced by calling the function
directly before the change and after, now read on presence, and pinned
by a case whose mutation (restoring the `.get()`) turns it and nothing
else red.
- One ordering problem found while checking the above, pre-existing and
not fixed here: `tests/test_rpc_settings.py` run before
`tests/test_cli_onboard_commands.py` leaves
`raven.home._current_config_path` pointing at a dead tmp config, so the
onboard cases write somewhere else. With main's own copies of both files
and main's conftest in the tree it is 57 failures; with this branch's,
19. Which cases turn red changes run to run as xdist distributes them
differently.
- `cd ui-web && npx vitest run` -> 876 files, 3728 passed, 0 failed;
`npm run lint` -> 0 errors (4 warnings, all in files this change does
not touch); `npm run gen:check` -> in sync (228 methods); `npm run
type-check` -> clean; `cd ui-tui && npm run lint:i18n && npm run
lint:rpc` -> in sync
- `make lint-python` / `lint-imports` (10 contracts kept) / `lint-types`
/ `lint-deps` -> all pass; `uv lock --check` -> exit 0 with both sides'
new packages present; `scripts/check_source_language.py` and
`scripts/check_large_files.py` on `github/main..HEAD` -> exit 0;
commitlint over every commit -> ok
- Semantic-conflict audit of the rebase, beyond what the suite answers:
21 of the branch's 66 files are also in main's 499, and every one of
main's changes in them is additive and elsewhere in the file. The one
that could have broken silently is main's new `vision.model` /
`vision.provider` simple keys meeting this branch's new
`plugins.config.<id>.<field>` branch in `settings_set`; nothing in the
suite exercises `vision.*` through that method, so it was run directly
-> `{'applied': True}` and `{"model": "..."}` on disk. The subtraction
decisions were re-checked against the new base: no new caller of a
memory backend's `delete`, main's new onboard cases are about TLS and
not the memory step, `inherit_everos_address` exists nowhere, and
`DEFAULT_EVEROS_BASE_URL` is still defined.
- Mutation runs on the new code, restored afterwards: dropping `owned:
false`, letting the host's credential overwrite the product's own, not
writing the host's backend name, and carrying every memory slice instead
of the one in force each turn their own cases red; making the cloud card
render nothing turns 4 of its 5 new cases red and leaves the fifth
("draws nothing when not selected") green.
From the earlier round, on base `6d509a8c5`:
- `uv run --frozen --python 3.12 --extra dev pytest -p no:cacheprovider
-q tests/test_everos_cloud_fake.py tests/test_everos_cloud_backend.py
tests/test_everos_cloud_backend_contract.py
tests/test_everos_cloud_onboard.py tests/test_everos_cloud_discover.py
tests/test_cli_onboard_commands.py tests/test_rpc_memory.py
tests/test_rpc_settings.py tests/test_plugin_boundary.py
tests/test_rpc_schema_match.py tests/test_rpc_registration.py
tests/test_release_plugin_list.py
tests/integration/test_everos_cloud_real_cloud.py` -> 1001 passed, 6
skipped (the six live tests, no key)
- `cd ui-web && npx vitest run` -> 214 files, 3211 passed; `npm run
lint` -> 0 errors (4 warnings, all in files this change does not touch);
`npm run gen:check` -> in sync (207 methods); `cd ui-tui && npm run
lint:rpc && npm run lint:i18n` -> in sync
- `make lint` (ruff, ruff format, ui tsc, deptry) -> ok; `make
lint-types` -> All checks passed; `make build-ui` -> boot snapshots
match; `scripts/check_large_files.py` and
`scripts/check_source_language.py` on `6d509a8c5..HEAD` -> exit 0;
commitlint and `scripts/check_commit_messages.py` on each commit -> ok
- Mutation runs per change (restored afterwards, `git diff` clean): a
host import of the plugin turns the boundary test red; `import
raven_everos` in the plugin turns the import-isolation test red;
removing the chooser's cancel exit, the Bearer header, the restart
guard, the slice-admission guard, the Roles filter and the fake's two
fixes each turn their own test red
- Real-host acceptance (64 cases,
`docs/specs/2026-10-08-everos-cloud-memory-acceptance.md`) run against a
fake EverOS Cloud: the wizard in tmux (chooser, key typed / from env /
on file, 401 / 403 / unreachable wording, back, Off, Ctrl-C,
non-interactive, base-tree transcript byte-identical with one plugin),
`raven agent` turns (user and agent-track recall, agent-mode adds, 4 s
recall bound, a 300 KB message dropped with a warning, a sub-agent trace
stored under its own ids, flushed and read back, one exit flush per
unflushed session), `raven import run` (3 adds then one flush; a hung
flush retried 4x and the exit sweep defeated), `raven doctor` under
seven cloud conditions (seven sentences, exit 2 only for the five
faults) and with the distribution hidden, and the web page through
playwright-cli (memory page counts and the fake's episode, empty and
refused stores, the Model page hiding the three EverOS-only roles while
the embedding row stays, the cloud card rotating a key and showing the
401 wording, three refused settings.set frames over the gateway
WebSocket, the local everos / null / mem0 backends drawing the page as
before, and a provider-key save that restarts the local EverOS on the
base tree and does not on this branch). Evidence and the per-case
verdicts are kept outside the repo. The live service was reached with a
real key after the acceptance run: six tests, six passes, the service's
replies archived with the evidence.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
User-visible changes: the wizard's step 4 chooser (only when two memory
plugins are installed); Model settings hides the three EverOS-only role
rows when `memory.backend` is not `everos`/`null` and draws no cloud
card; the memory page sends a Bearer header for the cloud backend.
Two behaviour changes for agent products, both on the `agents/` lane
only. An agent product now follows the host's `memory.backend` and
endpoint instead of its own, which is a fix for the four products that
never followed the host and a change for `raven-design`, which followed
the endpoint but not the backend. And a product no longer starts an
EverOS server of its own: where it used to answer a host that was not
serving by starting one against an empty root of its own, it now reports
long-term memory as unavailable, which is what the host does. Rollback
for this part is the one commit; the product configs it edits are
shipped files, not user config. The plugin is not installed by default
(its wheel is built by the release workflow; nothing changes for an
install without it). Rollback: revert the squash commit; the config
schema gains no new key (the slice is a plugin slice), so an older raven
reads a config written by this one.
Credentials: the cloud key is written only by `set_plugin_config_fields`
into the plugin's slice; the settings page's key row goes through
`settings.set` with a manifest-declared field, and
`settings.everosCloud` reports `api_key_set` / `key_source`, never the
value.
## Related Issues
N/A
---------
Co-authored-by: gloryfromca <23442919+gloryfromca@users.noreply.github.com>
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
Bundled ACP agents could fail to start on Windows when rendering
configuration, reading stdin, or replacing the launcher process. Closing
an ACP connection could also fail before releasing its process and
transport because Windows has no os.killpg.
- Keep all five bundled Windows launchers alive until their ACP child
exits, forward the exit status, and apply the same behavior to new
scaffolded launchers. POSIX retains exec.
- Preserve live rendered configurations with the cross-platform PID
probe, retain POSIX file permissions, and preserve seed-file line
endings.
- Read Windows stdin pipes through a daemon feeder with PeekNamedPipe
and reads bounded by the available bytes.
- End the live launcher's Windows process tree with bounded taskkill
before releasing the transport. Leave an already-exited launcher's PID
alone.
- Preserve a completed session/new reply when EOF shutdown cancels its
optional model-menu lookup. The first LiteLLM import can exceed the
five-second grace even after #909 removed the metadata-network delay.
Active-connection cancellation and cancellation during required session
setup still propagate.
- Run real stdio handshakes, all five launchers, command registration,
and native teardown cases in Windows CI. The handshake now also runs
with a fresh bytecode cache.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Native Windows build 10.0.26300, Python 3.13.12, PYTHONUTF8=1. The final
tree is based on the fetched main revision; all eight patches replayed
unchanged. The last upstream update adds bug-report upload/receiver code
and has no file overlap with this PR. The 19-case selection below was
rerun on the final tree; the broader selection and controls predate that
last unrelated update. Tests used isolated user/Raven homes, frozen
dependencies, and verified imports from the tested checkout. Run-owned
--basetemp and --junitxml output paths are omitted from the selections
below.
- `uv run --frozen --no-sync pytest
tests/test_acp_server.py::TestFrameLoop::test_session_creation_answers_when_eof_cancels_the_catalogue
tests/test_acp_methods.py::TestConfigOptions::test_session_creation_preserves_cancellation_outside_shutdown_metadata
tests/integration/test_acp_stdio_smoke.py
tests/test_cli_agents_commands.py::test_register_pins_the_resolved_row_into_the_host_roster
tests/test_subagent_acp.py::test_close_without_killpg_ends_the_tree_through_taskkill
tests/test_subagent_acp.py::test_close_without_killpg_kills_nothing_by_the_pid_of_an_exited_launcher
-m 'integration or not integration' -n 0 --tb=short`: **19 passed, no
skips** after the final rebase. This includes both EOF timings,
cancellation controls, both bytecode-cache states, all five real
launchers, and real taskkill. One non-failing idle-ceiling warning was
reported.
- `uv run --frozen --no-sync pytest tests/test_acp_server.py
tests/test_acp_methods.py tests/test_acp_updates.py
tests/test_acp_config_options.py tests/test_cli_acp_commands.py
tests/test_config_product_render.py tests/test_utils_pid.py
tests/test_agents_code_launcher.py tests/test_agents_design_launcher.py
tests/test_agents_oncall_launcher.py tests/test_agents_ppt_launcher.py
tests/test_agents_research_launcher.py tests/test_cli_agents_commands.py
tests/test_subagent_acp.py tests/test_rpc_bootstrap.py
tests/test_subagent_host_env.py tests/test_subagent_probe.py -n 0
--tb=short`: **1284 passed, 58 failed, 10 skipped, 4 errors**. The same
selection on the rebased PR immediately before the EOF fix returned
**1280 passed, the identical 58 failing and 4 error test IDs, and 10
skipped**. No new failure/error IDs from the EOF fix.
- All 62 failure/error IDs were also selected on main: 56 failed, 4
errored, and 2 passed. Those two passed in isolation on this PR too, and
failed in the complete selection both before and after the EOF fix. The
remaining failures include Windows path, shell/command, and
symlink-privilege cases. The attempted complete main selection stalled
in the pre-existing Windows stdin tests and was terminated; no complete
main-suite result is claimed.
- Before the EOF fix, `uv run --frozen --no-sync pytest
tests/integration/test_acp_stdio_smoke.py::test_a_whole_handshake_runs_in_one_process[cold_imports]
-m integration -n 0 --tb=short` failed with response IDs [1, 3]. A
separate stack-capture probe measured 6.76 seconds in the first LiteLLM
import; the handler awaited model.options while its worker imported
LiteLLM and its dependencies.
- `uv run --frozen --no-sync pytest
tests/test_acp_server.py::TestFrameLoop::test_session_creation_answers_when_eof_cancels_the_catalogue
tests/test_acp_methods.py::TestConfigOptions::test_session_creation_preserves_cancellation_outside_shutdown_metadata
-n 0 --tb=short`: before the fix, 2 failed and 2 passed. Both EOF cases
failed with the missing session reply. They pass with the fix and are
included in the broader post-rebase selection above. Warm/cold real
handshakes plus these four cases also passed as a six-case selection.
- A mutant that treats every connection as closing makes the
ordinary-cancellation control fail. Cancellation during required session
setup still propagates.
- `uv run --frozen --no-sync ruff check raven evolver agents
plugins-dist tests scripts docs-site` and the corresponding `ruff format
--check`: passed; 2266 files already formatted.
- `uv run --frozen --no-sync lint-imports`: 10 contracts kept. `uv run
--frozen --no-sync ty check raven/acp/methods.py raven/acp/updates.py
raven/acp_client/client.py raven/cli/acp_commands.py
raven/config/product_render.py`: passed.
- `uv run --frozen --no-sync pre-commit run --from-ref origin/main
--to-ref HEAD`: every applicable hook passed. The two final docstring
edits also passed their file-scoped pre-commit run.
- `node node_modules/@commitlint/cli/cli.js --from origin/main --to HEAD
--config commitlint.config.cjs`, `uv run --frozen --no-sync python
scripts/check_commit_messages.py origin/main..HEAD`, `uv run --frozen
--no-sync python scripts/check_large_files.py origin/main...HEAD`, `uv
run --frozen --no-sync python scripts/check_source_language.py
origin/main...HEAD`, and `git diff --check origin/main...HEAD`: passed.
- The PR body passed the repository body checker and an explicit ASCII
scan.
The broader Windows selection remains red, so the relevant-tests
checkbox is unchecked. This revision has no new Linux or full repository
run, live LLM workload, rendering workload, or ACL audit. POSIX-only
skips are not counted as Windows passes.
- [ ] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
At EOF, a completed session/new can omit optional configOptions when
shutdown cancels a slow lookup; the sessionId and session modes are
retained. Active connections keep their existing model-menu behavior.
The handler grace remains five seconds.
Windows keeps the launcher present while its server runs, and connection
close waits up to five seconds for taskkill. Idle Windows pipe input
polls every 10 ms. Redirected files and text streams retain their
existing reader path. POSIX retains exec and 0600 permissions; Windows
rendered files inherit directory ACLs.
There is no configuration-format change. Previously generated agent
folders retain their existing launchers; the scaffold change applies to
new folders. Revert this PR to roll back the launcher, stdin,
process-cleanup and EOF-response changes.
## Related Issues
#909
## Summary
raven-research reports were written for a grader: fixed `## Answer` /
`## Findings` / `## Limitations` headings, HTTP codes beside links, and
a
chat reply that drifted from the file saved with `write_file`. This
branch
ships them in a reader layout and closes the gaps that product runs on
DeepSeek showed between the brief, the reply and the saved file.
Reader layout (`finalShape.reportLayout = "reader"`, on for
raven-research):
- The report opens with the answer as a blockquote, with no label or
bold
lead-in. Anything the brief asks the report to open with (a retrieval
date, the kinds of sources) follows in the blockquote. Delivery facts
the
brief asks back (path, counts) go on its last line, which the chat reply
keeps and the saved file leaves out.
- The body sits under its own `##` headings, using the brief's section
names word for word, numbering included, when it gives them. The last
section names what could not be verified (`## Limitations` in English;
the reply's language otherwise, with no English word in that heading).
The shape gate reads the last `##` section as the limits when no word it
knows names them, since no word list covers every language, and when
only the first heading has such a word with no body above it (a body
heading on export limits is body, not limits). The audit reads it the
same way and counts a body written as prose under the answer.
- Prose cites through markdown links, with no fetch status beside them.
A
brief that asks for link checks gets one table before the limits,
listing
every cited URL as fetched, with its status, marked blocked where the
site blocked the fetch.
- The layout is derived from the deep clause, so the evidence rules stay
one text. The shape gate, its reminder, rewrite prompt and interrupted
fallback, and `scripts/research_report_audit.py` read it as the same
three parts. A test pins the audit's limits matcher to the gate's.
Chat and file are one text: at turn end the delivered reply is written
over
the report file the turn wrote. Which file that is:
- A markdown file the turn wrote whole, or appended to or edited when
the
turn wrote it whole first or it still holds exactly what an earlier turn
of the session left in it. The session record keeps the sha256 the
session left in each report file, checked at turn start before any tool
runs. Any other file (a log the user keeps, a report the user changed
between turns) holds someone else's text, so it is never the report. A
later turn that only edits a report nobody else touched still syncs it.
- Whose `##` headings are at least half the reply's. On the
reader-layout
product runs a report draft shared 75-100% of its headings with the
reply, and a notes file saved beside the report shared none, so a notes
file or a source index is never overwritten, alone or beside the report.
- Of several such files, the one the reply names; when it names none or
more than one, every file is left alone.
The file keeps its `#` title when the reply has none. It is also left
alone
when the reply is not a report, or when the reply is under 80% of the
file's length, so a summary reply never replaces the report. The path is
read from the first line of the tool's result only, matched against the
tool's whole fixed wording, and the file tools now
refuse a path that carries a line break or other control character: they
echo the path into their results, so such a path could forge a second
result line naming a file outside the workspace.
Length and counts, measured rather than estimated:
- Every markdown write or edit gets a `[report length: ...]` line on its
tool result, carrying:
- CJK characters and other words, with prose and tables apart;
- the same counts per `##` section;
- the number of distinct URLs cited, extracted the way the research
trail extracts them.
- The report checks a brief's length against that line, and takes any
count it states (sources included) from it.
- `write_file` now reports bytes. Its success line said "N bytes" and
counted characters, so a Chinese report was sized at about a third of
its real length.
Fetch status and the research trail:
- The research fetch tool reports the target's own status from the Jina
reader's header instead of the reader's 200, and marks a CAPTCHA wall as
`blocked`.
- The trail counts such pages as refused by the site, not as read, per
fetch: a page refused once and read on a retry counts as read. When a
thin page is re-read at another address, each address keeps its own
status: the stub its own, each fallback the one in its own header.
- The trail drops click-tracking parameters (`utm_*`, `srsltid`,
`gclid`,
`fbclid`, `msclkid`) before matching a citation.
- Its `<details>` folds are now plain labelled lists, since a terminal
shows the tags raw.
- `scripts/research_report_audit.py` reads the refused-page clause and
note. It also reads the reviewer verdict when the trail names the
reviewing model. That second break predates this branch: a model id
carries `/` and `-`, so the verdict read as missing on every product
trail.
Other:
- The research reviewer now runs on DeepSeek in thinking mode. That
provider refuses a named `tool_choice` with HTTP 400, so every review
failed open and each report shipped unreviewed. The gate retries with
`tool_choice=auto`.
- `measuredGuidance` is off in the shipped config. Its numbers were
measured on a short-answer benchmark and pull a long report toward a
terse answer.
- The appendix twin's guard names the twin's lead over the frozen dr@3.5
record instead of requiring the two to be equal: 4 added and 5 changed
definitions, with `ResearchTrail` compared member by member so its
untouched members stay pinned. The record itself is unchanged from
`main`.
- The product label moves to the `-reader` suffix. Its digest was
re-stamped several times on this branch only; `main` never shipped an
intermediate digest.
Checked and deliberately not changed here:
- The main agent's own `web_fetch` (`raven/agent/tools/web.py`) also
reads through Jina and still reports the reader's 200 for a target
error. It is a separate module, not a twin of the research tool, so it
needs its own change.
- `fetch_result_ok` is unchanged, so a page the site refused still
releases the fetch gate, counts toward the evidence floor and enters the
conversation memo as a source. Changing it would move when the gate
releases.
- The report sync writes the file directly, not through `write_file`, so
it
emits no file-change event and a client's diff panel does not show it.
raven-research runs with no write approval, so no approval is bypassed.
- Every CAPTCHA flag in 36 local fetches that carried a reader warning
was
on a page of 862 characters or fewer. Target errors appear on pages of
up to 18k characters, and each one checked was a real error page. No
false positive was found.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Run after rebasing onto the current `origin/main`. The range-diff
against
the pre-rebase branch is `=` for all 15 commits.
- `uv run pytest tests/test_agents_research_*.py
tests/test_research_*.py tests/test_filesystem_write_modes.py
tests/test_agent_tools_web_fetch.py tests/test_history_trimmer.py
tests/test_context_engine*.py -q`: 1070 passed.
- Full suite before the rebase, `uv run pytest tests -q`: 27745 passed,
118 skipped, 12 failed. None of the 12 were introduced by this branch:
- 11 fail identically in clean worktrees of `origin/main` and of the
branch head. They are environment-bound: proxy redaction, NAT64
addresses, the node path.
- `test_agents_ppt_launcher` passes in the clean branch worktree and
failed only because of an uncommitted local edit to
`agents/raven-ppt/subagent.json`.
- Mutation checks: each of these, reverted alone, turns its new tests
red:
- the target-status override;
- the refused-page split;
- the ledger classification;
- choosing the named report file (3 tests fail with `paths[-1]`);
- the audit's refused clause;
- the audit's ` via ` terminator.
- After the second review round:
`uv run pytest tests/test_agents_research_*.py tests/test_research_*.py
tests/test_filesystem_write_modes.py tests/test_filesystem_tools.py
tests/test_deliver_files_tool.py tests/test_rpc_files.py
tests/test_rpc_turn_send.py tests/test_tool_registry_execute.py
tests/test_tools_workdir.py tests/test_agent_tools_web_fetch.py -q`:
1238 passed. Each fix, reverted alone, turns its new test red: the
control-character refusal, the first-line read, the append rule, the
last-section limits (gate and audit apart), the fallback verdicts, and
the URL count, the per-fetch refusal, the draft-heading filter and the
session-wide edit rule. The twin guard fails on an undeclared definition
and on a
stale lead entry.
- After the third review round, on the rebased head:
`uv run pytest tests/test_agents_research_*.py tests/test_research_*.py
tests/test_filesystem_write_modes.py tests/test_filesystem_tools.py
tests/test_deliver_files_tool.py tests/test_rpc_files.py
tests/test_rpc_turn_send.py tests/test_tool_registry_execute.py
tests/test_tools_workdir.py tests/test_agent_tools_web_fetch.py
tests/test_history_trimmer.py -q`:
1278 passed. Mutants each turn the new tests red: the unanchored
unchanged-file match; the control-character guard narrowed to LF, or to
`Cc` only; each of the four success lines reworded in the real tools;
a twin-only change to an untouched `ResearchTrail` default.
- After the fourth review round, same command: 1288 passed. Mutants each
turn the new tests red: held files taken without the digest check, the
digest never recorded, held files ignored, the first-heading rule
reverted in the gate and in the audit apart, the gate's body-above
condition dropped, and the audit's prose-body count dropped.
- `make lint-python`, `make lint-imports`, `make lint-deps`,
`make lint-types`: all pass.
- `scripts/check_commit_messages.py origin/main..HEAD`,
`scripts/check_source_language.py origin/main...HEAD`,
`make check-large-files`: all exit 0.
- Product runs through the TUI host, on reports about personal agents,
AI
glasses, AI coding agents, office agents and edge AI:
- The saved file equals the reply, less the delivery line, with its
title kept.
- The stated length and source count match the `[report length]` line.
- The link-check table has one row per counted URL.
- A Gartner 403 and an HBS 405 behind a CAPTCHA came through with their
real status.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
User-visible changes:
- raven-research replies and saved reports change form: an answer
blockquote, no fixed headings, no HTTP codes beside links, and a single
link-check table.
- The report file a research turn wrote is overwritten with the
delivered
reply at turn end, except in the cases above.
- `read_file`, `write_file`, `edit_file`, `list_dir`, `deliver_files`
and
the RPC file reads refuse a path containing a line break or other
control
character (they share `resolve_path`).
Existing installs keep the contract they seeded into
`agent_memory/profile/agent.md`. The new layout reaches them only after
that file is deleted; until then the gate still accepts the old
three-heading replies. The changelog says so.
Not covered by this branch:
- The research subagent pins `contextWindowTokens` to 65536. On a host
model with a 1M window, the budget note reaches 80-136% early and cuts
research short. Left as is on purpose; it is a separate decision.
- Post-delivery behaviour of the host agent is unchanged. It may recount
or edit the report after delivery.
Rollback: revert the squash commit. To keep the code but drop the
layout,
set `finalShape.reportLayout` to `"sections"` in
`agents/raven-research/config.json`.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: userName20260323 <270284818+userName20260323@users.noreply.github.com>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
Stored Windows launch commands were parsed with POSIX rules, which
removed backslashes from unquoted interpreter and launcher paths. Launch
consumers now share platform-aware parsing and quoting, while retaining
compatibility with single-quoted absolute paths saved by older callers.
- Read legacy single-quoted drive, UNC, and absolute POSIX path tokens
on Windows, including path values after `=` and the quote concatenation
emitted for apostrophes inside a path. Decode only that token so
neighboring native Windows arguments keep their backslashes and literal
apostrophes. Launch and readiness use the same compatibility decoder.
- Preserve quoted paths in discovery and stale-row checks. Escaped
quotes, CR/LF separators on POSIX, and arguments made only of
backslashes no longer hide or merge a launcher path.
- Share substitution across discovery, registration, scaffold smoke
checks, generated installers, and all five shipped installers. Older
Raven versions without the resolver refuse unsupported spaced command
paths before registration, while keeping plain paths and separately
passed working directories supported.
- Quote Raven's own ACP executable and forwarded config path for the
launch platform. Resolve bare programs on the child's PATH in directory
order, preferring executables within each directory. ACP may resolve
configured batch shims; prompt-bearing CLI and Kimi calls retain their
lookup restriction.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Checked on native Windows using an existing uv environment, with the
source imported from the reviewed checkout and `PYTHONUTF8=1`.
```text
uv run --no-sync python -m pytest tests/test_utils_commands.py tests/test_subagent_vendored_agents.py tests/test_subagent_builtin_agents.py tests/test_subagent_registry.py tests/test_subagent_third_party.py::test_cli_backend_preserves_stored_windows_path_quotes tests/test_subagent_host_env.py::test_acp_launch_preserves_stored_windows_path_quotes tests/test_subagent_probe.py::test_windows_probes_find_a_legacy_single_quoted_program -q -x -n 0
```
Result: 292 passed. This covers a real CLI child launched through the
backend, ACP spawn arguments, CLI/ACP availability probes, and
existing/missing launcher checks, with both legacy and native quoting
controls.
The final 25 added cases were also run in an isolated process with the
previously published parser: 12 failed and 13 passed. Four isolated
mutations were caught: disabling compatibility (8 failures), removing
the launch quote guard (1), removing the readiness quote guard (1), and
using POSIX parsing for the entire Windows command (15). A seeded
50,000-case check through the native producer and both consumers
reported no argv or readiness-token mismatches.
Whole-branch checks:
```powershell
$prFiles = @(git diff --name-only origin/main...HEAD -- '*.py')
uv run --no-sync ruff check @prFiles
uv run --no-sync ruff format --check @prFiles
$production = @($prFiles | Where-Object { $_ -notlike 'tests/*' })
uv run --no-sync ty check @production
uv run --no-sync lint-imports
uv run --no-sync pre-commit run --from-ref origin/main --to-ref HEAD
uv run --no-sync python scripts/check_commit_messages.py origin/main..HEAD
uv run --no-sync python scripts/check_source_language.py origin/main...HEAD
uv run --no-sync python scripts/check_large_files.py origin/main...HEAD
git diff --check origin/main...HEAD
```
All passed: 24 Python files passed Ruff checks; production type checks
passed; all 10 import contracts were kept. The pinned commitlint CLI
also passed over the full branch range. The final documentation-only
follow-up changes no executable behavior.
Limits: a broader Windows selection stopped after 283 passing tests at
`test_cli_probe_reports_the_resolved_absolute_path`, whose bare POSIX
shell fixture is not resolved as a Windows executable. This is not
counted as a passing suite. The ACP regression checks the arguments
delivered to process creation; it does not claim to verify the existing
POSIX-only process-group shutdown path on Windows. The local Docker
daemon was unavailable, so no new local Linux or macOS run is claimed.
The full repository suite and a live WebUI dispatch were not run locally
for this revision.
The pre-submit sweep covered the complete branch diff, all command
producers and consumers, native/legacy quoting boundaries, installer
fallbacks, failure paths, test strength, layer contracts, repository
gates, and these disclosed verification limits.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No screenshot update applies. Parser docstrings describe the legacy-path
compatibility and how to preserve literal quotes.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
Compatibility applies to single-quoted absolute path tokens, including
path values after `=`; it does not enable general POSIX shell syntax on
Windows. Non-path apostrophes remain literal. To preserve literal single
quotes around path-looking data, quote the entire argument with native
double quotes. Existing stored path tokens are read compatibly without
rewriting configuration; newly generated commands keep native quoting.
POSIX launch parsing is unchanged. Readiness preserves foreign
absolute-path spellings and checks launcher existence; it is not a
general command validator. Older installers reject paths their Raven
version cannot represent before changing the roster.
ACP batch shims execute configured server arguments through cmd.exe.
Prompt-bearing CLI and Kimi calls do not opt into batch lookup. A CLI
agent installed only as an npm shim still needs an explicit executable
path. Reverting the squash commit restores the prior behavior.
## Related Issues
#880
---------
Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>
Co-authored-by: Codex <noreply@openai.com>
## Summary
The image role in Settings offered OpenRouter alone, although
`image_generate` already speaks the OpenAI Images API
(`/images/generations`, `/images/edits`) on any other base. A user with
an OpenAI or OpenAI-compatible provider could reach it only by
hand-editing `tools.media.image.apiKey` and `apiBase`.
`tools.media.image` gains `provider`. A section naming one runs on that
provider's address, key and headers as one group, taken from the
endpoint the key comes from and resolved at call time the way the
embedding pin is (`provider_connection`, factored out of
`resolve_provider_credentials`); the section's own `apiKey`, `apiBase`
and `extraHeaders` stand aside. Every media request sends the section's
`extraHeaders` (a new field, secret like a provider's own) after the
bearer key, the order the chat route gives a provider's `extra_headers`.
The registry declares which providers the image tool can run on
(`ProviderSpec.image_api`: OpenRouter, OpenAI, Custom), `model.options`
carries the flag per row, the roles card offers exactly those for the
image slot, and `settings.set` refuses any other. An OpenRouter pick
writes an empty provider, so existing sections keep their current
meaning. Speech and video keep to OpenRouter: their sections have no
`provider` field, so one written there is ignored on every reader, and
`settings.set` and `set_media` refuse it.
Two fixes on the same path:
- The OpenRouter key, `providers.openrouter.apiKey` or
`OPENROUTER_API_KEY`, is borrowed only by a section that calls
OpenRouter's address. A keyless section pointed at another endpoint used
to send that endpoint the OpenRouter key as its bearer token.
- Off OpenRouter, every image model goes to the Images API. The chat
route with output modalities is OpenRouter's own; an OpenAI-compatible
relay answered it with its own 404 (`model is not found`), which the
OpenRouter-only fallback did not recognise, so a model outside the
Images API name list could not generate there.
The live config reader resolves the named provider's section exactly as
boot does: every spelling, former name and field alias of it goes
through `ProvidersConfig`, which folds them into one section, and no
other provider's section is validated. A section header replaces the
key's header of the same name in any case.
raven-ppt and raven-design inherit the host's image section through the
same resolver. When raven-ppt pins an image setting, the section becomes
a snapshot read as written: it drops the provider name and takes the
Wire Model that provider uses. A pinned key or base leaves the inherited
headers behind, since they complete the host's key at the host's
address. A pinned base also clears whatever key the host resolved, so
the deck's key slot decides afresh: `PPT_IMAGE_API_KEY`, the host
section's own key, or, toward OpenRouter only, the key that pays for the
words. That closes a leak every 0.2 release has, the OpenRouter key the
host borrowed for OpenRouter's address going to a pinned deck base. On a
named provider's own address the deck sends that provider's key or none.
The launcher can outlive its raven, since a stamped home tree outranks a
checkout's own `agents/`, so it calls only what every 0.2 release has:
the reader's two-argument form, and `media_provider` looked up where it
exists.
The settings dialog's design and acceptance specs (C14, A22, A24 and
their decisions) are amended to the new rule.
Overlap: open #432 and #433 (MiniMax images and video) edit
`_generate_one`, the video tool's `execute`, a `_resolve_key` override
on each tool, and the lines beside the removed `borrows_openrouter_key`.
Their MiniMax routes return before the routing this change touches and
their overrides delegate to the base resolver, so the conflicts are
textual.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run --frozen --python 3.12 --all-extras pytest -q`: 27601 passed,
7 failed, 115 skipped. The 7 fail identically on `origin/main` 3632e6040
on this machine (five proxy tests in `test_config_update_providers.py`
under the shell's proxy variables,
`test_install_script.py::test_resolve_node_dir_answers_each_case_it_exists_for`,
and
`test_subagent_node_runtime.py::test_what_cannot_be_read_names_nothing`
run as root); 0 introduced.
- ui-web, `node node_modules/vitest/vitest.mjs run
--no-file-parallelism` (both test roots, 214 files): 3188 passed, 0
failed, 0 unhandled errors. Measured before the review commits, which
touch no TypeScript, generated file or RPC contract.
- ui-tui, the same command (144 files): 2089 passed, 9 failed, 0
unhandled errors. The 9 are rendering tests in four files that fail with
identical ids on `origin/main`'s ui-tui on this machine; 0 introduced.
- `tsc --noEmit` in ui-web and ui-tui, `gen-rpc-client.mjs --check`,
`gen-rpc-types.mjs --check`, eslint over the touched ui-web directories,
and `ruff format --check` / `ruff check` over the changed Python files:
all clean.
- `scripts/check_commit_messages.py origin/main..HEAD`, commitlint over
the same range, `scripts/check_source_language.py origin/main...HEAD`,
`scripts/check_large_files.py origin/main...HEAD`: all exit 0.
- The new tests were written first and watched fail for the missing
behaviour, the review rounds' tests on the head before each fix. A
mutation pass then removed each construct this change adds, one at a
time: 40 Python and 3 TypeScript mutants, all killed but one, controls
green. The survivor matches a provider on its name instead of its
`route_names`, which is equivalent today because every former name in
the registry is also a field alias.
- Each commit added in review passes the touched test files on its own.
- Live, against an OpenAI-compatible relay serving
`sensenova-u1.5-lite`: before, `image_generate` with the section's own
`apiKey`/`apiBase` posted to `/chat/completions` and got 404. After, on
an isolated `raven web` in Chromium, the image row offered Custom,
OpenAI and OpenRouter (speech and video OpenRouter only), the typed id
was added to Custom as an image model and saved as `{model, quality,
provider: "custom"}`, and one call through the live config reader
returned a 2048x1536 PNG from `/images/generations` with the Custom
provider's key.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No user-facing documentation covers the media tools; the settings
dialog's specs carry the rule.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
- Security: credentials travel to fewer places. A section borrows only
from the provider it names, address and key together, and a provider
with no known address supplies no key. `tools.media.image.provider`
joins the `settings.set` whitelist with the reach the subsystem pins
already have: it moves the tool to a provider the operator configured,
and names no address and carries no key.
- Provider headers can carry credentials: they travel with the key to
the provider's own address only, a video poll or content URL on another
origin gets neither, and a media section's `extraHeaders` is masked like
a provider's. The OpenRouter default lane still borrows only the
OpenRouter key, not that provider's headers.
- A keyless image, speech or video section whose `apiBase` is not
OpenRouter's now reports a missing key instead of borrowing the
OpenRouter key. A relay in front of OpenRouter at another address needs
`apiKey` on the section.
- On such a base, a model outside the Images API name list (a Gemini
image model, say) now goes to `/images/generations` instead of
`/chat/completions`.
- Choosing a provider other than OpenRouter in Settings sets aside a
hand-written `apiKey`/`apiBase` on the image section; they stay in the
file and apply again once an OpenRouter model is picked.
- A `provider` hand-written into `tools.media.speech` or
`tools.media.video` is now ignored: that section runs on OpenRouter,
with the OpenRouter key.
- raven-ppt: a deck pinning `PPT_IMAGE_API_KEY` no longer sends the
host's `extraHeaders`, so an endpoint that also routes by header cannot
take the deck's own key; before this change no header travelled at all.
A deck pinning `PPT_IMAGE_API_BASE` without a key of its own no longer
receives the OpenRouter key the host borrowed; it needs
`PPT_IMAGE_API_KEY`, the host section's own key, or a base on
OpenRouter's address.
- The raven-ppt launcher still renders under every 0.2 release, which
lacks `media_provider`; a test runs it against a reader with the 0.2
signature.
- Rollback: revert the squash commit. The previous config models ignore
a saved `provider`, so the image tool returns to OpenRouter with the
earlier key rules.
## Related Issues
Fixes#828
---------
Co-authored-by: Claude (claude-opus-5-5[1m]) <noreply@anthropic.com>
## Summary
Follow-up to #841, which lets an agent inherit an OAuth-backed host
model. Since #841 a launcher refuses when the host's selected model
cannot authenticate, but the refusal still said the host config had no
provider key to inherit from. That is untrue in the case #841 made
reachable: the host holds an OpenRouter key while its selected model is
OpenAI Codex with no sign-in.
- `inherit_refusal(config, host)` in `raven/config/product_render.py`
returns the `MissingCredentialsError` summary for the binding
`inherit_llm` checks, or `""` when it would inherit. `inherit_llm`
keeps answering a refusal with `""`, the value every launcher branches
on, scaffolded copies outside this repository included. Both now run
on two private helpers, so the inherited binding is composed in one
place. A non-string `agents.defaults.model` with no provider now
reaches `Config` validation instead of `split_model_id`, so
`host_can_lend_a_key` answers False where it raised `AttributeError`
past its except clause.
- The four keyed launchers and the `raven agents new` template print
that reason and keep the `<KEY> is not set` prefix the scaffold smoke
check matches; raven-design appends it to its own sentence. All six
look `inherit_refusal` up with `getattr` and, on an older raven that
lacks it, refuse with the same sentence without the reason: a folder
the template generates is never refreshed when raven changes
version, and a home tree a newer wheel copied out also serves an
older checkout.
- An agent is spawned with the login shell's environment, and with
raven's own environment only when that shell cannot be captured, so
a `CHATGPT_TOKEN_DIR` or `CHATGPT_AUTH_FILE` set only in the host
process does not normally reach it. This PR documents that rather
than forwarding the variables: the spawn path adds the host's
`RAVEN_HOME` when one is set, and with it unset both sides normally
resolve `~/.raven`, so the default token location is shared; a
custom override can live in the login profile or the agent's stored
row `env`. `agents/README.md` and the `host_can_lend_a_key` and
`host_config` docstrings say so, and the `host_can_lend_a_key`
docstring says why setup can still offer an inheritance the launcher
refuses -- the agent's environment and config are not the host's --
and names the routes, among them a `RAVEN_HOME` from the login
profile or from the agent's stored row. Three older texts in files
this PR edits, which said the launcher inherits `RAVEN_HOME`, say
instead that it normally shares the host's home.
- CHANGELOG records the clearer refusal.
Checked and deliberately left as is:
- `inherit_llm`'s docstring moved below the new helpers verbatim, apart
from the pointer to `inherit_refusal`, so it keeps its older wording;
`git diff --color-moved` shows the move.
- The smoke check in `raven agents new` still matches the old "no
provider key to inherit from" text, because scaffolded copies in
users' homes keep printing it.
- `MissingCredentialsError.remedy` is not appended: every summary this
check raises carries its own command or is answered by the launcher's
closing "configure a provider in the host raven", and the generic
remedy is multi-line.
- A malformed host provider section still ends a launcher with a
validation traceback, exactly as before; the call that raises it
moved into a helper unchanged.
- The same unconditional `RAVEN_HOME` claim also sits in
`raven/agent/subagent/role.py`, twice in `CONTEXT.md` and in
`docs-site/docs/oncall.md` with its Chinese twin. None is in a file
this PR edits, and all predate it; they are left for a separate
change.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Targeted, on the head:
```
uv run --frozen --python 3.12 --all-extras pytest -q -p no:randomly tests/test_config_product_render.py tests/test_subagent_vendored_agents.py tests/test_agents_design_launcher.py tests/test_cli_agents_commands.py tests/test_cli_smoke.py tests/test_agent_schemas.py
```
382 passed, 2 skipped. Deleting each construct this PR adds turns that
run red: the non-string guard (2 failed), the empty-summary fallback
(1), `inherit_refusal` reading its `config` (1), and, in each of the
six launchers, the reason and the parentheses around it (1 each; 2
for the template and for raven-design) and the `getattr` lookup (1
each, when replaced by a direct attribute read). The same run passes
(382 passed, 2 skipped)
with provider API keys exported and `CODEX_HOME` and
`CHATGPT_TOKEN_DIR` pointing at a fake sign-in, so the refusal tests
do not depend on the machine lacking credentials.
Full suite:
```
env -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy -u no_proxy uv run --frozen --python 3.12 --all-extras pytest -q -p no:randomly
```
2 failed, 27580 passed, 115 skipped. Both failures also fail at the
base, 3632e6040, on this machine and touch nothing here:
`test_install_script.py::test_resolve_node_dir_answers_each_case_it_exists_for`
(an npm elsewhere on PATH leaks past the fixture) and
`test_subagent_node_runtime.py::test_what_cannot_be_read_names_nothing`
(the run is root, which reads a file the test made unreadable). The
proxy is unset because five unrelated provider tests fail when the
shell carries this machine's proxy.
Lint and gates: `ruff check` and `ruff format --check` over the twelve
changed Python files, `ty check` over the eight non-test ones, and
`lint-imports` (10 kept, 0 broken) are clean;
`scripts/check_commit_messages.py origin/main..HEAD`, `commitlint
--from origin/main --to HEAD`, `scripts/check_source_language.py
origin/main...HEAD` and `scripts/check_large_files.py
origin/main...HEAD` exit 0.
Rendered refusals, the first from a host with an OpenRouter key and an
unsigned Codex model, the second from `raven agents new demo-agent` in
a home with no key:
```
error: CODE_API_KEY is not set and the host's model cannot be inherited (openai_codex needs a sign-in -- run `raven provider login openai-codex`); put the key in <agent dir>/.env (see .env.example), export it, or configure a provider in the host raven
error: DEMO_AGENT_API_KEY is not set and the host's model cannot be inherited (no provider is configured yet -- run `raven onboard` for guided setup); put the key in <agent dir>/.env (see .env.example), export it, or configure a provider in the host raven
```
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- The refusal wording changes for raven-code, raven-oncall,
raven-research, raven-ppt, raven-design and the scaffold template; a
script matching the old "no provider key to inherit from" text stops
matching for these launchers.
- The launchers and the template now reach `render.inherit_refusal`
through `getattr`, because each can meet a raven that predates it: a
folder `raven agents new` generated is never refreshed, and the
packaged tree is re-copied on a version change only in the wheel
shape, so a home tree a newer wheel copied out also serves an older
checkout. Every other function they call exists back to v0.2.0, and
on such a raven they refuse without the reason.
- No secret reaches the message: a summary names a provider and a
command, never a key value.
- Rollback: revert the squash commit; nothing is stored or migrated.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
#841
---------
Co-authored-by: Claude (claude-opus-5-5[1m]) <noreply@anthropic.com>
## Summary
Allow all five shipped agents to inherit an OAuth-backed host model,
including OpenAI Codex, by validating the inherited model binding with
the runtime credential check after parent session overrides.
- Reuse the launcher's inheritance decision in setup and update its
English/Chinese message.
- Preserve raw provider settings, routing, reasoning effort and product
limits. OAuth tokens remain in the host credential store.
- Cover OAuth aliases, access/refresh tokens, missing or malformed
credentials, custom token paths, parent bindings and independent agent
keys. Remove the old API-key-only gate exemptions from the auth contract
test.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Selected regression tests: **321 passed, 48 deselected** on Windows with
Python 3.12. The selection focuses on inheritance and excludes untouched
POSIX permission/pruning scenarios.
```powershell
uv run --no-sync pytest tests/test_config_product_render.py tests/test_subagent_vendored_agents.py tests/test_cli_subagent_setup.py tests/test_provider_auth_method.py tests/test_providers_factory.py tests/test_openai_codex_provider.py tests/test_providers_oauth_login.py tests/test_i18n_prompts.py tests/test_i18n_boundary.py -q -o addopts='' -p no:cacheprovider -k '(not test_config_product_render or inherit_llm or launchers_inherit_oauth or launchers_own_keys or secret_slots or env_wins or dig_and_put) and not prune and not backup and not locks_it_down and not test_a_page_sign_in_runs_the_real_driver_and_leaves_the_token_owner_only' --cov=raven.config.product_render --cov=raven.agent.subagent.vendored_agents --cov=raven.cli.subagent_setup --cov=raven.i18n --cov-branch --cov-report=json:C:/Users/Administrator/AppData/Local/Temp/raven_issue809_coverage_final.json --cov-report=term-missing:skip-covered
```
The following checks passed: Ruff across the repository, formatting
(2149 files), relevant type checks, all 10 import contracts, commit
messages, source language and file/asset checks.
```powershell
uv run --no-sync ruff check raven evolver agents plugins-dist tests scripts docs-site
uv run --no-sync ruff format --check raven evolver agents plugins-dist tests scripts docs-site
uv run --no-sync ty check raven/config/product_render.py raven/agent/subagent/vendored_agents.py raven/cli/subagent_setup.py
uv run --no-sync lint-imports
uv run --no-sync python scripts/check_commit_messages.py main..HEAD
uv run --no-sync python scripts/check_source_language.py main..HEAD
uv run --no-sync python scripts/check_large_files.py main..HEAD
```
Changed-line coverage: **100% (22/22 executable lines)** after
normalizing the Windows report's path separators.
```powershell
uv run --no-sync python -c "import json,pathlib; p=pathlib.Path('C:/Users/Administrator/AppData/Local/Temp/raven_issue809_coverage_final.json'); d=json.loads(p.read_text(encoding='utf-8')); d['files']={k.replace(chr(92), '/'):v for k,v in d['files'].items()}; p.with_name('raven_issue809_coverage_posix.json').write_text(json.dumps(d), encoding='utf-8')"
uv run --no-sync python scripts/coverage_gate.py --coverage-json C:/Users/Administrator/AppData/Local/Temp/raven_issue809_coverage_posix.json diff --base-ref main --head HEAD --threshold 90
```
Full local CI remains unverified: `make ci` could not run because make
is unavailable. Existing POSIX file-permission tests fail on Windows.
`uv run --no-sync deptry raven` reports 12 missing optional channel
dependencies in this environment.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
Inheritance now refuses an unavailable selected model even when an
unrelated provider has an API key. API-key and independent-agent-key
paths remain covered. Credential validation only reads stored OAuth
credentials; it does not sign in or serialize tokens. Revert this change
to restore the previous inheritance gate.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
Fixes#809
---------
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: KT <74288668+0xKT@users.noreply.github.com>
## Summary
Raven can now read and change its own configuration through one tool,
`raven_config`, instead of telling the user to open Settings or editing
`config.json` with file tools. The same path lets it connect preset
sub-agents and diagnose the ones that do not answer, and asks the user
only for what needs them (a key, a sign-in, a paid model).
**The tool and its catalog**
- `raven_config` actions: `describe` (every setting with its value, or a
search), `get`, `set` (one path, or several under one confirmation),
`unset`, `add` (connect presets, several at once), `test`, `restart`
(reload or restart once pending changes are gathered). `session.model`
switches only the current conversation.
- `raven/config/self_surface.py` is the catalog: 14 sections, about 93
settings, each with its value kind, its writer, and when a change takes
effect (next turn, at once, reload, restart, memory server, or inert).
Writes go through the RPC methods the settings page already uses
(`SELF_CONFIG_METHODS` allowlist), so the page and the agent share one
validation path. `tests/test_config_self_surface.py` holds every entry
against the schema and every next-turn claim against a real reader.
- A refused sub-agent comes back with one next step per refusal kind (9
Raven fixes itself, 5 the user does), with stop rules: no hunting for
keys, no credential stores, no restarting another app's services, stop
after three commands that explain nothing.
- `subagents.add` stays preset-only: every execution field comes from
the preset. Presets can be named by display name, an add can pin a model
the agent lists, and a model pick on an unmeasured agent reads the
handshake menu first.
- The companion skill `raven-self-config` describes the whole flow; its
description is injected every turn, the body is read on demand.
**Approval**
- Reads run unasked. Every write asks by default, on a dedicated config
card (what changes, before and after, when it takes effect, a sensitive
note). A grant for the session never carries a change.
- In a turn someone is at, full access, the user's allow rule, and smart
mode's reviewer let a change through; the reviewer never approves a
sensitive setting. Sensitivity is declared by the owner: catalog entries
(approval mode and review model, workspace confinement, sandbox, deny
patterns, disabled tools, MCP servers switched on, skill blocklist and
auto-install, provider endpoints, web and media proxies, remote
machines, workspace path, lent keys, sub-agent descriptions) and each
channel adapter's spec (who may instruct Raven, whether a channel is on,
where its credentials and traffic go, encryption). The gate and the tool
read a call the same way: one value decoder, one path spelling, one
channel field lookup, an object value judged field by field; a path the
tool does not write is refused at the gate, and a call naming one
setting twice is refused. A value is secret when the schema, the channel
spec or the catalog says so, a credential-named env entry, any header,
or a credential inside a URL. The reviewer's instruction counts the
agent's own non-security settings as ordinary work. Unattended turns
(cron and other scheduled runs, no one to answer) are refused; a channel
user who can answer an approval is attended.
**Secrets**
- A key never travels through a tool call. The agent names the secret
with an empty value and a credential card of its own
(`credential.request` / `submit` / `skip` / `pending` / `closed`) takes
it; the host writes it through the handler that owns it and the model
learns only saved or skipped. Channel secrets use the same card. A call
that only asks for keys goes straight to the card. Enabled on page
surfaces only.
- Tool output is scrubbed of the values Raven holds
(`config/held_secrets.py`, including JSON-escaped spellings and URL
credentials) and dotfile reads under home are redacted, once, inside
`ToolRegistry.execute`, so the trace span, the page's diffs, the
sentinel and both agent loops get the scrubbed copy. What a sub-agent
says is scrubbed where it is kept: transcripts, call labels, closing
text, the output a later DAG node renders, error records, announces, the
ACP frame journal, probe details. A key pasted into the chat is refused.
- Lent keys: an ACP sub-agent row can name Raven providers (`lendKeys`)
whose key it is started with. The row stores the provider name; each
start (the spawn path and the capability probe) reads the key into the
variable the preset reads (`presets.LENDABLE_KEYS`, Pi only for now), so
it never reaches the model and follows a rotated key. Verified live: Pi
refused without it, answered with Raven's OpenRouter key, and its row
reads connected and tested with a 398-model menu.
**Page**
- Config card and credential card; the model and permission chips
refresh after the agent changes them; the transcript names
`raven_config` calls by what they did.
- Agents page: the note on a refused connect, a failed test, or a check
that found a problem offers "Hand it to Raven" on its title line; it
opens a new conversation with a prompt naming the agent and the reason,
not sent. A connected row whose check found a problem now shows one head
line and an amber note in the body (shaped like a failure's) instead of
the check's English sentence folded under the head.
**Other**
- Memory LLM left unset follows the main model (EverOS restarts when the
main model moves).
- Reload and restart wait for page turns in flight too.
- `plugin` points agents and chat apps at `raven_config`; `cron` names
the missing `message`; a GNU `timeout` shim on hosts without one,
accepting only the durations the permission gate parses (one shared
definition); read-only package-manager subcommands allow.
- Contracts: `CONTRACTS_VERSION` 35 (this branch's credential types plus
main's `FileWrite`) with the surface repinned; paper-tier line ceiling
3,700 (measured 3,682) with its review note. `CONTEXT.md` defines the
self-configuration surface and lent key.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run pytest -q -n auto`: 27187 passed, 3 failed. The 3 fail on this
machine regardless of this branch:
`test_rpc_files::test_a_host_without_libreoffice_says_so` (LibreOffice
is installed here),
`test_simulation_scenario::test_a_fresh_trial_refreshes_the_subagent_homes_before_it_runs`
and
`test_simulation_suite::test_a_stopped_run_is_marked_in_its_record_and_finished_with_its_evidence`.
`schemas/subagent.schema.json` is regenerated for `lendKeys`;
`test_import_cycle_budget` holds (the capability probe takes the launch
env from its caller rather than importing the agent layer).
- `make lint-ui` (gen:check, eslint, tsc): pass; the 4 eslint warnings
are in files this branch does not touch.
- `npx vitest run` in `ui-web`: 3116 passed; `check-css`,
`check-class-namespace`, `check-page` OK.
- `npm run lint:i18n`, `lint:rpc`, `type-check` in `ui-tui`: pass.
- `uv run ruff check` and `ruff format --check` on every changed Python
file, and `lint-imports` (10 contracts kept): pass.
- In a browser against a local gateway: credential card save, skip,
replace and reload replay; the value appears in no session, trace or
log. Agents page link opens a new task with the prompt filled and
unsent; sent, the agent reads the self-config skill and calls
`raven_config` first, and for Pi offers Raven's key before a sign-in.
- Smart-mode reviewer, run against the real model: 7 ordinary config
changes allowed; `sed` or `write_file` on Raven's config, reading an SSH
key, and `curl | sh` escalated.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
- Behaviour changes: the agent can now change settings and connect
sub-agents after the user confirms (or unasked under full access, and
under smart mode for non-sensitive settings). Lending gives a sub-agent
Raven's key for a provider after an explicit, sensitive confirmation;
what it spends is billed to that key.
- Memory: a memory LLM left unset now follows the main model, so
long-term memory starts working after the upgrade for anyone who never
pinned one, extracting on the main model and billed to the main
provider's key, and EverOS restarts when the main model changes. To keep
it off, set `memory.backend` to null; to keep it on a different model,
pin one of its own.
- Backward compatible: new config fields are optional, and both probe
fingerprints include `lendKeys` only when set, so recorded verdicts and
menus survive. A `config.json` written with `lendKeys` will not load on
an older build (`extra=forbid`).
- Rollback: revert this PR; nothing is migrated. To switch the feature
off without a revert, add `raven_config` to `tools.disabledTools`.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: arelchan <204152633+arelchan@users.noreply.github.com>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
- Pass research-flow turn settings to the loop so configured wall-clock
and retry budgets, ask labels, and interrupted-reply guidance take
effect.
- Give interrupted research replies the configured report structure.
Buffer the tool-free synthesis, request one format repair when sections
are missing, and emit only the selected reply. A failed synthesis
produces a structured fallback.
- Use an accurate time-limit fallback for wall-clock exhaustion. Agents
without a synthesis policy keep their existing generic path.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- [x] Relevant tests pass locally: `uv run pytest
tests/test_agent_loop_max_iter_synthesis.py
tests/test_agent_loop_dead_end_retry.py
tests/test_agent_loop_run_emit.py
tests/test_agents_research_flow_report_shape.py
tests/test_agents_research_flow_finalize.py
tests/test_agents_research_mode_tiers.py
tests/test_agents_research_launcher.py -q -n 0 -m 'not slow' --tb=short`
(243 passed after syncing main).
- [x] Relevant lint / type checks pass locally: `uv run ruff check
raven/agent/loop/_shared.py raven/agent/loop/__init__.py
raven/agent/loop/turn_path.py
agents/raven-research/plugins/research-flow/research_flow/flow.py
agents/raven-research/plugins/research-flow/research_flow/gates/report_shape.py
tests/test_agent_loop_max_iter_synthesis.py
tests/test_agent_loop_dead_end_retry.py
tests/test_agents_research_flow_report_shape.py`; `uv run ruff format
--check raven/agent/loop/_shared.py raven/agent/loop/__init__.py
raven/agent/loop/turn_path.py
agents/raven-research/plugins/research-flow/research_flow/flow.py
agents/raven-research/plugins/research-flow/research_flow/gates/report_shape.py
tests/test_agent_loop_max_iter_synthesis.py
tests/test_agent_loop_dead_end_retry.py
tests/test_agents_research_flow_report_shape.py`; `make lint-types`;
`make check-source-language`; `make check-large-files` (all passed).
- [ ] User-facing docs or screenshots are updated when needed. None are
needed for this runtime fix; `CONTEXT.md` defines the new runtime term.
## Risk
- [x] Security impact considered: repair calls have no tools and use
only the turn's existing transcript and draft.
- [x] Backward compatibility considered: other agents keep the generic
wrap-up; research-flow now enforces its configured time budget and may
use one extra tool-free call when formatting fails.
- [x] Rollback path is clear for risky changes: revert this change to
restore the prior synthesis path and research-flow handoff behavior.
## Related Issues
N/A
## Why
In a research -> code -> oncall chain run on 2026-09-22, Raven-Code
called
`exec(machine="conn_cpu_32c")` and got "No connection is registered", on
a home
whose `connections.json` listed seven machines. It then read
host/port/key out
of the config and ran a raw `ssh root@<ip> -p <port> -i ~/.ssh/id_rsa`,
putting
the way in into the transcript.
Two gaps:
1. **Read side.** `raven.ops.connections.store_path()` looked only
beside the
instance's own config. A sub-agent runs on a rendered config in its own
state
directory, so it looked in an empty directory. The host already hands
every
sub-agent `RAVEN_HOME`; the registry just was not looked for there. Only
the
on-call launcher worked around this (it sets `RAVEN_CONNECTIONS`
itself).
2. **Write side.** `ops_connection_add` (#545) lived in the on-call
plugin. In the
usual chain the coding agent runs first, meets the empty registry first,
and
had no way to take the owner's answer.
## What changes
- `store_path()`: env var -> `raven_home()/connections.json` if it
exists ->
beside the config if THAT exists -> the home (where a first add lands).
An
install that kept its own list beside its config keeps working.
- New `raven/ops/connection_add.py`: `probe`, `ssh_defaults`,
`parse_probe`,
`write`, `write_ssh_alias`, and `ASK_OWNER` (the questions relayed to
the owner).
The tool calls these functions directly; `raven ops connection add` (the
terminal command for a person) calls the same ones, so the logic exists
once.
- New `raven/agent/tools/connection_add.py`: `ops_connection_add` as a
trunk tool,
**opt-in** via `tools.connectionAdd` (on in raven-code and raven-oncall,
off in
the other three products, whose pinned tool faces are unchanged).
- `raven.ops.transport.make_ssh_runner(identities_only=)` +
`ISOLATE_IDENTITY`,
moved from the plugin: a key the tool picked itself is probed with that
key
alone (see #545 review).
- On-call plugin: `oncall_flow/connections.py` imports trunk's reader
instead of
keeping a hand-aligned copy (758 -> 212 lines); keeps only campaign
lookups
(`get`, `display_name`, `resolve_into`, `describe`). Its own tool file,
factory and manifest row are removed.
- Raven-Code guide (`TOOLS_CODE.md`) gains when to leave this computer:
write
here; verify where the software is; ask the owner for a machine only
when
installing the software here is wrong (GPU, memory) or heavy (compiled
solver,
toolchain, long download); never ssh from an address in the task
statement.
- `SHOWN` made public in `raven.ops.connections` (the plugin may not
import an
underscored trunk name; `_SHOWN` stays as an alias).
- Docs: `docs-site/docs/oncall.md` / `oncall.zh.md` updated for the new
lookup
and the tool.
## Not in scope
- The pre-dispatch registry gate removed in a44664d1b is NOT restored.
Where a
job runs is still decided inside the agent that runs it; this only makes
that
agent find the owner's registry and able to add to it.
- #552 (exec refuses a typed ssh to a registered machine) is
complementary: it
only fires once the registry is visible, which this makes true for
Raven-Code.
## Tests
- `tests/test_ops_connection_add.py` (moved from the plugin suite,
patches trunk
modules), including the ssh `-G` measurement that only the candidate key
is
offered under isolation.
- Five new cases in `tests/test_ops_connections.py` for the lookup
order.
- Plugin parity tests replaced by an identity pin (the plugin's names
ARE trunk's
objects).
- Code launcher face ledger gains a machine lane; oncall face unchanged.
- Full suite: see CI.
@LivXue -- review requested: this touches `raven/ops` and the
`RAVEN_CONNECTIONS`
handoff described in a44664d1b.
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
Generated with Claude Code (https://claude.com/claude-code)
---------
Co-authored-by: xiaotian.luo <xiaotian.luo@thetahealth.ai>
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
Two faults that left the template-based deck lane (Raven-PPT) without
search and without web pictures on a current raven install.
1. **Web keys were not inherited from a vendor-table host.**
`agents/raven-ppt/run.py` only merged the two pre-vendor leaves
(`tools.web.search.apiKey`, `tools.web.jinaApiKey`). A host configured
on a current raven keeps those keys under
`tools.web.providers.<vendor>.apiKey`, so the rendered product config
carried no web key: `web_search` was withheld and `ppt_image_search`
declined. In a live run the author called both, got "tool is not
available", and spent six minutes paging a wiki API for picture file
names instead. The render now inherits every vendor slot the host fills,
unless the product already holds a key for that vendor (its own config,
or `PPT_SERPER_API_KEY` / `PPT_JINA_API_KEY`, which land in the leaf
trunk reads after the vendor slot, so inheriting the host slot would
outrank them). The host's `search.provider` / `fetch.provider` follow
where the product names none, so a key and its vendor choice travel
together. The engine slice's `imageSearch.apiKey` is taken in trunk's
order: vendor slot, then leaf. `raven-design` already copies the host's
`tools.web` whole; `raven-research` already reads the vendor table.
2. **`ppt_fetch` was refused by Wikimedia and others.** Downloads used
httpx's default `python-httpx/<version>` user agent, which
upload/thumb.wikimedia.org, en.wikipedia.org and sz.gov.cn answer with
403. All five Commons pictures in that run failed and the author fell
back to `curl`, which lands pictures without their captions (the figure
catalogue then held 19 images with `caption: null`). Downloads now send
`raven-ppt/<version> (+https://github.com/EverMind-AI/Raven)`. Measured
with curl on macOS: the same URLs return 403 with the httpx agent and
200 with this one (also checked bbc.com, arxiv.org, github.com: 200).
Not in this PR: `agents/raven-code` and `agents/raven-oncall` read the
same two legacy leaves only and likely have the same gap on a
vendor-table host.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run pytest tests/test_agents_ppt_launcher.py
tests/test_ppt_engine_fetch_tool.py -q`: 93 passed.
- The 5 new tests with the source changes reverted: 4 failed (the
own-key-precedence test is a guard and passes either way); with the
changes: all pass.
- `uv run pytest tests/test_subagent_vendored_agents.py
tests/test_config_product_render.py
tests/test_ppt_engine_prompt_claims.py
tests/test_agents_design_launcher.py -q`: 188 passed, 1 skipped.
- `uv run ruff check` and `uv run ruff format --check` on the four
changed files: clean.
- curl on macOS against the Wikimedia, Wikipedia and sz.gov.cn URLs from
the failing run, with both user agents (results above).
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
A deck lane on a vendor-table host now gets the host's web keys and
vendor choice, so `web_search` and `ppt_image_search` appear where they
were missing; a product-level key still wins. The fetch user agent
changes for every download; a site that only accepted browser agents
would still refuse, as before. Rollback is reverting this commit; the
env keys (`PPT_SERPER_API_KEY`) keep working either way.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
One plugin that failed to activate dropped every plugin.
`PluginRegistry.activate` raised on the first plugin whose factory would
not import (or whose contribution name collided), and
`build_plugin_registry` (`raven/core/plugin_stack.py`) answered by
returning an empty registry. A single broken user plugin therefore
silently removed research-flow, ppt-engine, design-engine, the memory
backend and the bundled playbook tools, with one stderr warning as the
only trace. Reproduced with two mock plugins under a scratch
`RAVEN_HOME`: `aa-broken` (factory raises `ImportError`) beside
`zz-good`; before this change the registry came back with `activated:
[]`, after it with `design-engine, everos-memory, playbook, ppt-engine,
zz-good` activated and `aa-broken` named as failed.
Changes:
- **Per-plugin activation** (`raven/plugins/registry.py`). Each admitted
plugin activates on its own. One that fails is rolled back whole (no
partial contribution in any table, and the `sys.path` entry
`_ensure_importable` appended for it is withdrawn), recorded as a
`PluginActivationFailure` (`activation_failures()`), and the plugins
after it still activate. In a name conflict the plugin activated first
(discovery order, by id) keeps the name and the other is recorded as
failed. A module `__getattr__` that raises something other than
`AttributeError` is now a recorded failure rather than an uncaught
crash.
- **Said to the user** (`plugin_stack.build_plugin_registry`,
`runtime.build_runtime`). Each failure is one notice naming the plugin,
its cause and the `plugins.disabled` escape, through the host's notifier
(`HostWiring.notify`), else stderr - the same channel the
missing-memory-backend notice already uses. When the configured memory
backend belongs to a plugin that failed, the memory notice names that
plugin and its cause instead of "no installed plugin provides it".
- **`raven plugins`** shows a `failed` status and the cause under the
table (the command called `activate` directly and previously crashed on
such a plugin).
- **Agents smoke check** (`raven/cli/agents_commands.py`) matched the
old log line "plugin activation failed", which no longer exists; it now
reads the shared `PLUGIN_FAILURE_MARKER`, and its test prints the notice
the real producer writes, so the two cannot drift.
- **Sub-agents inherit the host's opt-outs**
(`product_render.write_rendered`, `inherit_plugin_opt_outs`). A product
engine inherits `RAVEN_HOME`, so it scans the host's `<home>/plugins`
and the shared interpreter's entry points, but it read
`plugins.disabled` only from its own rendered config; a plugin disabled
on the host came back in every product. Every render now merges the
host's list after the product's own. The product's own engine plugin
never travels (`own_plugins=`, passed by all five launchers and the
scaffold): the PPT agent is `ppt-engine`, and a host turning it off for
its own agent is not a request to run the PPT agent without it. A
contract test reads every launcher's `write_rendered` call and requires
it to name its `*_PLUGIN_ID`.
- `CONTEXT.md` (Plugin Registry) and
`docs-site/docs/building-plugin{,.zh}.md` describe the new behaviour.
Not in this PR: the Web UI plugin list (`ext.list`) is discovery-only
and does not show a failed plugin; adding it is a wire change
(`ExtListResult`, openrpc, generated TS, the page) and is left for a
follow-up. The TUI, gateway and `raven agent` hosts show the notice
through their notifiers; the rpc stack (serve/acp) prints it to stderr,
which is also what the agents smoke check reads.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
**Rebased**: head 7cd000dbc on origin/main 8ee5ae0d8, without conflicts.
`git range-diff` shows every commit replayed unchanged. The branch's own
test files rerun at this head: 395 passed. Numbers elsewhere in this
description are from earlier heads.
Head b4d51aee8, rebased onto origin/main 6551f8259 after #698 and #708
merged. #698 conflicted in `raven/config/product_render.py` and
`tests/test_config_product_render.py`: both PRs added a function at the
same spot (`inherit_host_denials` there, `inherit_plugin_opt_outs` here)
and a call in `write_rendered`. The resolution keeps both functions and
all their tests; `write_rendered` now reads `host_config()` once and
passes it to both. #708 touches none of these files. At this head:
```
COLORTERM=truecolor uv run --frozen --python 3.12 --all-extras pytest -q -p no:cacheprovider
25948 passed, 109 skipped
uv run --frozen --python 3.12 --all-extras pytest -q tests/test_config_product_render.py
44 passed
ruff check / ruff format --check / make lint-imports lint-deps lint-types / git diff --check origin/main...HEAD
check_source_language.py origin/main...HEAD / make check-commits / check-large-files
all clean
cd ui-tui && npm run lint:rpc && npm run type-check && npm test
144 files, 2106 passed
```
The earlier `TUI checks` failure (run 35834019105, head 5fc374035) was
`newInstancePicker.test.tsx > quick-selects by the number it printed`.
This PR changes nothing under `ui-tui/`; the test passed 5 of 5 runs
locally at this head and in the full ui-tui run above.
The numbers below are from the earlier heads and are kept for the
record.
```
uv run --frozen --python 3.12 --extra dev ruff check raven evolver agents plugins-dist tests scripts
All checks passed
uv run --frozen --python 3.12 --extra dev ruff format --check raven evolver agents plugins-dist tests scripts
2083 files already formatted
make lint-imports && make lint-deps && make lint-types
Contracts: 10 kept, 0 broken / No dependency issues found / All checks passed
git diff --check origin/main...HEAD
clean
COLORTERM=truecolor make coverage (full suite, head before rebasing onto 7fdf296f4)
25847 passed, 109 skipped
COVERAGE_BASE_REF=origin/main make coverage-diff
Diff coverage: 100.00% (71/71 executable changed lines)
PYTHONPATH=. uv run --frozen --python 3.12 --extra dev python scripts/check_source_language.py origin/main...HEAD
exit 0
make check-commits
pass
git merge-tree --write-tree HEAD origin/main
clean
```
After rebasing onto 7fdf296f4 (its two new commits touch none of these
files), the touched suites at this head:
```
COLORTERM=truecolor uv run --frozen --python 3.12 --all-extras pytest -q tests/test_plugin_*.py tests/test_core_plugin_stack.py tests/test_cli_plugin_commands.py tests/test_cli_agents_commands.py tests/test_cli_tui_commands.py tests/test_config_product_render.py tests/test_agents_*launcher*.py tests/test_everos_plugin_discovery.py tests/test_release_plugin_list.py tests/test_cli_gateway_commands.py
727 passed
uv run --frozen --python 3.12 --all-extras pytest -q tests/test_subagent_vendored_agents.py tests/test_rpc_subagents.py tests/test_subagent_acp.py
452 passed
```
Revert-to-red, one production file restored to origin/main at a time
with the tests kept:
```
raven/plugins/registry.py -> 2 errors (plugin_stack imports PluginActivationFailure)
raven/core/plugin_stack.py -> 6 failed
raven/core/runtime.py -> 1 failed (build_runtime hands the host's notifier to the registry)
raven/config/product_render.py -> 42 failed
raven/cli/agents_commands.py -> 1 failed (smoke reds a handshake whose plugin did not load)
raven/cli/plugin_commands.py -> 1 failed (failed row and escaped cause)
agents/raven-ppt/run.py -> 2 failed (engine exemption, launcher contract)
```
Ten existing tests pinned "activation raises" (`test_plugin_registry`,
`test_plugin_bootstrap`, and the conflict tests for tools, hooks, tool
gates and session observers). They now assert the new contract instead:
the later plugin is recorded with the same reason text, the earlier one
keeps the name, and nothing of the loser is registered. Two stubs in
`test_cli_tui_commands.py` took `build_plugin_registry(cfg)` and now
accept the `notify` keyword.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- A plugin conflict used to disable all plugins; it now keeps the plugin
that activates first and skips the other with a notice. Two plugins
contributing the same name therefore run with one of them instead of
none.
- A product sub-agent now starts with the host's `plugins.disabled`
merged into its config (its own engine excepted). A plugin that was
disabled on the host but relied on inside a product stops loading there;
the remedy is to enable it on the host.
- `PluginRegistry.activate` no longer raises `PluginConflictError` /
`PluginFactoryImportError`; the only in-tree callers were
`assemble_plugin_registry` and `raven plugins`. The exception classes
stay exported.
- Security: the change only narrows what loads. A failed plugin's
directory leaves sys.path, and the inherited opt-outs can only remove
plugins from a product, never add one.
- Rollback: revert the squash commit.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
## Summary
A design subagent's artifacts live in a directory of its own, one level
below the directory its spawning turn dispatched it into. The dispatch
receipt the parent holds names the directory it dispatched into, and the
run's reply names its files as relative paths. Resolving one against the
other looked one level too high: measured on a real dispatch, the
parent's first `deliver_files` for `index.html` came back with no files,
and only a disk search run by the model itself found them on the second
attempt. A run that does not self-diagnose fails there instead of
delivering.
Two routes were available. The first was a new channel for a subagent to
report the working directory it actually moved into. The ACP pool tracks
`cwd` only as a launch parameter, the live binding is process-local, and
the host is forbidden from deciding anything out of Response Meta, so
that route meant a new protocol crossing the `agent` and `design-engine`
scopes, plus a host that reads a product's directory. The second was to
fix the handoff contract at its source: the reply names the directory it
worked in. This PR takes the second.
- `DesignParticipant.outbound` appends a final line: `Design session
directory: <abs>`, followed by `Paths in this reply resolve against it.`
It is emitted only for a directory this engine minted, recognised by the
same rule that owns it, so shared-directory mode and any turn that never
repointed are untouched.
- The directory name is now minted by one helper, `session_dirname`,
read from two seats: the one that makes the directory and the one that
recognises it again.
- The deck engine (`ppt-engine`) already names its artifact absolutely
in its reply tail, and an appended tail reaches an ACP caller over the
same `StreamDelta` path, so this makes the two engines agree.
- The host is unchanged: the receipt still names the dispatch directory,
and the run's own report rides through `_announce_result` inside the
untrusted fence, unread. The caller holds both facts, each true.
- `agents/README.md`'s raven-design note documents the new line.
Deliberately not done: no "search the disk when a path is missing"
heuristic in `deliver_files`, and `workdir_per_session` is unchanged.
Not covered: an in-process subagent dispatch (`Origin.SUBAGENT`) skips
the send chain entirely (`_SKIP_AFTER_SEND_ORIGINS`), so no reply tail
runs on that lane. That is pre-existing and separate; both shipped
engines run over ACP.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run pytest tests/test_design_engine_plugin_face.py
tests/test_subagent_manager.py tests/test_subagent_workdir.py
tests/test_agents_design_launcher.py -q` -- 298 passed, run after
rebasing onto `origin/main`.
- `uv run pytest tests/test_subagent_*.py -q` -- 1966 passed.
- `uv run pytest tests/test_design_engine_*.py -q` -- 163 passed.
- `uv run pytest tests/test_external_consumer_surface.py
tests/test_living_docs.py tests/test_ppt_engine_plugin.py -q` -- 103
passed.
- `uv run --frozen --python 3.12 --extra dev ruff check` and `ruff
format --check` on the changed files -- passed.
- `uv run --frozen --python 3.12 --all-extras ty check
plugins-dist/design-engine` -- passed.
- `make check-source-language` -- passed, and every added line was
verified ASCII by a character scan of the diff.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
Cases added, each falsifiable:
- `test_the_reply_names_the_session_directory_the_run_wrote_into` drives
the real loop, writes `poster.txt` through `write_file`, and asserts the
reply names the directory the write landed in and that the
reply-relative path resolves against it. Without the tail the reply
names nothing and the path does not resolve.
- `test_no_session_directory_line_for_a_binding_the_engine_did_not_mint`
pins the gate: no line when the engine never minted the directory.
- `test_announce_passes_through_a_run_that_reports_its_own_directory`
pins the receipt: the dispatch line and the run's own line both present,
with the run's line inside the untrusted fence. It fails if the host
ever lifts that report out of the fence into its own voice.
- `test_concurrent_sessions_keep_files_state_and_completion_separate`
now reads the tail for the completion notice rather than for `None`,
which keeps the property it held: a finished task is not nagged, an
unfinished one is.
## Risk
- User-visible: a design turn's reply carries one extra line, two with
the resolution note. Machine-written, in the same shape the deck
engine's `Deck:` / `MEDIA:` lines already use; a reader that ignores it
sees an ordinary reply.
- Backward compatibility: in place. The line is appended only when the
engine minted the session directory; the host's receipt, the fence
around the report, and the workdir binding are untouched.
- Rollback: revert the commit. The appended line disappears and the
previous behaviour returns exactly.
- Security: the appended text stays inside the untrusted fence on the
way back, and the host still reads none of the report. No new path is
trusted, and nothing new is resolved against a caller-supplied value.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
Make progressive tool disclosure safe to ship on, then ship it on.
`tools.toolSearch.enabled` now defaults to true. Below the compaction
threshold
that costs a deploy nothing (the strategy drops `tool_search` from every
request
while the catalog fits); above it, most schemas are withheld and reached
through
`tool_search` / `tool_call`, so context stops scaling with tool count
and an MCP
connect stops moving the prompt-cache prefix.
Two things had to land first, and both are here:
1. **The meta-pair is reserved from `tools.disabledTools`.** Their
absence from an
array is how the fold reads "this request has no search route", and it
answers
by shipping every schema. So an off switch there did not slim a folded
request,
it unfolded it -- mid-turn, since the switch is read once per assembled
array.
A measured turn went from 12 tools to 61 between two model calls,
discarding
the whole cached prefix. They join the MCP resource and prompt
meta-tools as
names the loop owns for its lifetime; `tools.toolSearch.enabled` speaks
for
both. The settings page needs no change: `ext.list` already reports them
as
builtin and the page draws a fixed control for those.
2. **A folded request names the connected MCP servers whose schemas it
withheld.**
The runtime context named a server only while it awaited authorization
or was
still connecting, so a connected one read as nothing at all and a model
that
did not think to search reported a capability it held as missing. One
line per
server, counting the tools this turn's array carries and the fold
removes --
not the manager's registered count, which includes a switched-off tool
that
search filters out and an always-visible one whose schema is present.
Knock-on changes: the four packaged agents drop their now-inert disable
rows, so
`tool_call` joins their faces and the ledger tests record it; each pins
`toolSearch.enabled` to false, which keeps a curated face off the fold.
The
strategy also stops assuming the array's shape -- replay feeds recorded
arrays
back through the same chain, and a corrupt recording used to end the
turn with a
TypeError instead of reaching replay's own backstop.
This replaces #609, which was cut from the pre-rebuild main. The commits
are the
same four plus one test fixture adjustment; the only dropped hunk is an
edit to
`ui-web/src/live/090-extensions.js`, which the frontend rebuild deleted
and whose
behaviour the rebuilt settings page already has.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Run on the branch tip, against github/main at 52eb09b25:
- `uv run --frozen --python 3.12 --extra dev pytest -q` with
SERPER_API_KEY unset:
24325 passed, 121 skipped, 0 failed.
- `uv run ruff check raven/ tests/` and `ruff format --check` on every
touched
Python file: clean.
- Both new guards were reverse-verified: with the reservation removed
`test_disabled_tools_cannot_withhold_the_meta_tools` fails; with the
notice
filter removed
`test_the_count_is_what_the_fold_withholds_not_what_the_server_registered`
fails.
- Note for reviewers: the packaged-agent face tests read SERPER_API_KEY
from the
environment despite being hermetic, so `web_search` joins the face and
they fail
on a machine that has one. That predates this branch and is untouched
here.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
User-visible: a deploy whose catalog passes
`tools.toolSearch.compactionThreshold`
(50 by default) now sends most tool schemas only on demand. A config
file that
spells `enabled: false` keeps today's behaviour with no action. Rollback
is that
one setting, or `compactionThreshold` raised past the catalog size.
Also user-visible: `tools.disabledTools` entries naming `tool_search` or
`tool_call` stop taking effect and are reported once at startup, and the
four
packaged agents now offer `tool_call`.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
Replaces #609. N/A otherwise.
---------
Co-authored-by: Claude (claude-opus-5[1m]) <noreply@anthropic.com>
## Summary
On 2026-09-20 one `find` call froze the whole gateway for 2h21m. The
model asked for `find(pattern="**/gps_trilateration/index.html",
path="/Users/admin")`, and `FindTool` ran `Path.glob` synchronously on
the event loop, filtered the noise directories only after walking them,
and had no deadline. The registry's 300s ceiling is an
`asyncio.wait_for`, which cannot preempt synchronous code, so every
session and every subagent on the gateway stopped until the walk came
back (`gateway.log`: `Tool result: find duration=8476519ms`). `list_dir`
with `recursive=true` had the same shape through `rglob`.
The fix gives the three tree-walking tools one walk,
`raven.agent.tools.tree_walk`, with these bounds:
- noise directories (`node_modules`, `.git`, ...) are pruned before they
are entered, not filtered afterwards -- the pruning tests spy on
`os.scandir` and assert the noise directory is never opened;
- the walk yields one entry at a time and checks a 20s wall-clock budget
(the value grep's fallback already used) before every entry, so whatever
the caller does with one entry -- the `stat` per `find` match, the read
per grep file -- is covered by the check on the next. The budget cannot
be overrun by one large or slow directory: the probe with eight matches,
a 30ms stat each and a 50ms budget returns 2 matches and the notice.
When the budget is hit, `find` and `list_dir` append a `PARTIAL result:
... traversal budget ...` clause to their trailer, and a deadline that
fires before any match is not reported as a clean `No files found` /
`Directory is empty`;
- every caller runs the walk in `asyncio.to_thread`, so the loop keeps
serving other sessions while the walk runs. Cancelling the thread does
not stop the worker, which is why the deadline lives inside the walk.
The pure-Python `grep` fallback already had the prune and the deadline;
it moves onto the shared walk and off the loop with the others.
`find` matches each path component with `fnmatch.translate`, with a
component that is exactly `**` spanning any number of components; the
matcher is a position-set simulation (`_advance`), linear in components
times segments, so a pattern carrying many `**` cannot make one match
call slow. A pattern's leading literal components decide where the walk
starts: `src/**/*.py` begins inside `src` and never lists a sibling of
it, a pattern that is all literal (`src/lib/c.py`, `src/lib`) names
exactly one path and answers without a walk, and the prefix itself is a
match when the rest of the pattern can match nothing (`src/**` still
lists `src/`). It answers exactly what `Path.glob` answered for the same
pattern: pinned by a parametrized oracle test over twenty-seven patterns
on a fixture and nineteen on a fixture with links (a directory link out
of the tree, a link cycle, a file link, a noise directory beneath a
link), and checked by hand against `Path.glob` over `raven/` for 27
patterns including bracket edge cases and trailing slashes, 0
mismatches. Two deliberate differences: a trailing `**` also lists files
beneath its prefix (3.12's `Path.glob` listed only directories there),
and a pattern with `..` or a leading `/` is refused instead of followed,
since a pattern must not reach outside the directory the fence resolved.
A trailing slash keeps `Path.glob`'s directory-only meaning (`*/`,
`src/**/`). A symbolic link to a directory is entered where a single
component names or matches it and never under `**`, which is how
`Path.glob` read a pattern: `*/util/helper.py` reaches through a linked
`vendor`, `**/helper.py` does not, and a link cycle is entered once per
component the pattern spends on it, so `*/*/*/b.py` enters `src/loop ->
src` twice and stops. The walker asks its caller per link (`follow`),
`find` answers from the pattern and hands the link positions of a path
to the matcher so `**` cannot claim them, and `list_dir` and the grep
fallback never ask, staying as `rglob` and `os.walk` left them. A third
deliberate difference from the merge base: a noise directory inside a
pattern's literal prefix (`node_modules/*.js`, `src/node_modules/*.js`)
is walked, since the pattern asked for it, where `Path.glob`'s filter
dropped it; one met below the prefix is pruned as before
(`*/node_modules/*.js` answers nothing), `list_dir` on such a path lists
it, and the `find`, `list_dir` and code-flow `glob` descriptions state
that rule instead of an unconditional "skipped". Review found an earlier
wording of the two `find` descriptions one component short ("except one
the pattern starts with"), while the oracle helper already pruned below
the prefix; the sentences now say what the helper checks, and the oracle
has the `src/node_modules` shape on both sides.
The raven-code `glob` tool (`agents/raven-code/.../tools/search.py`)
parses trunk `find` output line by line and strips the trailer before
merging brace alternatives. It learns the new clause, so a cut-short
child is reported as cut short rather than as a tree that lacks the
files; its `is_notice` grammar covers the new line so it is never pasted
into a listing as a path. The code-flow tool guide
(`prompts/TOOLS_CODE.md`), the wrapper's description and its `limit`
parameter told the model that a PARTIAL `glob` result means "raise
`limit` or narrow the pattern"; a traversal-budget PARTIAL is now a
result `glob` can return and a higher limit does nothing for it, so all
three now tell the two notices apart. The seeded copy of the guide
refreshes through the receipt `seed_guide` keeps beside it, so no legacy
digest is added.
Fixed in passing, and now pinned: recursive `list_dir` filtered `rglob`
results on the components of the absolute path, so a workspace beneath a
directory named `build`, `dist`, `venv` or another noise name listed as
"Directory ... is empty" (reproduced at the merge base under
`<tmp>/build/proj`; this head lists it). The shared walk prunes below
the listed path only; `find` and the grep fallback already did.
Not changed: the 20s value. It is the budget grep's fallback already ran
under; this PR does not re-measure it, it makes it hold for every entry
of every walk.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
At head 8dade176, on origin/main at d50a13c1 (nine commits: the walk,
the grep pin, the changelog, the per-entry budget with the prefix start,
the literal-directory case, the symbolic-link reading with the
noise-prefix wording, the noise-name-above-the-path pin, the guide
wording, and the prefix-rule wording; `git range-diff` against bb836988:
all nine replayed `=` onto the moved main, which conflicted only at the
changelog anchor and touches no file this PR touches):
```
uv run pytest tests/test_file_search_traversal_guard.py tests/test_agents_code_tools_plugin.py \
tests/test_search_tools.py tests/test_tools_workdir.py tests/test_tool_registry_execute.py tests/test_filesystem_tools.py -q
# 203 passed
COLORTERM=truecolor uv run --frozen --python 3.12 --all-extras pytest -q --ignore=tests/integration # in a throwaway worktree
# 24652 passed, 110 skipped in 382.30s (0:06:22) at head 8dade176, in a throwaway worktree with COLORTERM=truecolor
uv run pytest tests/test_agents_code_launcher.py tests/test_agents_code_tools_plugin.py -q # the guide's seeding and wording tests, the glob wrapper
# 119 passed
make lint-python lint-imports lint-types lint-deps # all pass
git diff --check origin/main...HEAD # clean
scripts/check_source_language.py origin/main...HEAD # exit 0
scripts/check_large_files.py origin/main...HEAD # exit 0
git merge-tree --write-tree HEAD origin/main # clean
```
Revert-to-red, with the tests kept (101 tests in
`test_file_search_traversal_guard.py` +
`test_agents_code_tools_plugin.py`):
```
the three production files reverted to the previously reviewed head (fd5663ee) 19 failed
file_search.py + filesystem.py reverted to origin/main, tree_walk.py removed collection error
```
Mutation, each mutant applied alone, control restored between runs:
```
deadline checked once per directory (the reviewed placement) 10 failed
walk starts at the root instead of the pattern's prefix 2 failed
trailing slash matches files too 4 failed
a pattern naming one file still walks 1 failed
the prefix itself is never a match 7 failed
a pattern naming one directory walks beneath it 1 failed
control (nothing mutated) 101 passed
```
From the first review round (still holding at this head): find without
`to_thread` 1 failed; list_dir without `to_thread` 1 failed; grep
fallback without `to_thread` 1 failed; pruning removed 6 failed; fork
drops the PARTIAL clause 1 failed.
Fourth round, the symbolic-link reading
(`test_file_search_traversal_guard.py` +
`test_agents_code_tools_plugin.py`, 128 tests, `-n 0`; a mutant that
lets `**` sweep a link, or forgets the link positions, re-enters the
cycle until the OS refuses the path and answers paths `Path.glob` never
did):
```
baseline 128 passed
MUTANT ** may sweep a link 8 failed (7 oracle cases, and the link the pattern ends at is opened)
MUTANT find never asks to enter a link 6 failed (the six oracle patterns that pass through a link)
MUTANT a link is entered even when the pattern ends at it 1 failed (scandir spy on **/vendor)
MUTANT ancestor links forgotten (links_of empty) 1 failed (a cycle case answers a path Path.glob never did)
MUTANT the walker consults follow but never enters 7 failed
MUTANT each followed root gets a fresh deadline 9 failed (every deadline test, and the walker's one-budget test)
REVERT production files to reviewed head d67184c8 7 failed
CONTROL restored 128 passed
```
Revert-to-red for the noise-name pin: with
`raven/agent/tools/filesystem.py` at the merge base and the test kept,
`test_a_noise_name_above_the_searched_path_hides_nothing` fails on the
`Directory ... is empty` answer (1 failed); at this head it passes. The
`agents/**` change is two prose strings and a guide line, outside the
coverage gate's `raven/**` and `plugins-dist/**` pathspecs; the guide's
name-list test and its seeding tests (`test_agents_code_launcher.py`)
cover the file.
The prefix rule is pinned by mutation, the other policy (prune a noise
directory inside the prefix) against the two guard files (131 tests, `-n
0`):
```
baseline 131 passed
MUTANT a noise directory inside the prefix is pruned 5 failed
test_find_matches_what_path_glob_matched[node_modules/**/*.py], test_find_matches_what_path_glob_matched[node_modules/*/], test_find_matches_what_path_glob_matched[node_modules/*/d.py], test_find_matches_what_path_glob_matched[node_modules/x/d.py], test_find_matches_what_path_glob_matched[src/node_modules/*.py]
CONTROL restored 131 passed
```
The symlink oracle is the reviewer's own test shape over a fixture with
links: `vendor -> outside/real`, `src/loop -> src`, `alias.py -> a.py`,
a `node_modules` beneath the link; 19 patterns, 0 mismatches against
`Path.glob` on 3.12, plus a scandir spy pinning that `**/vendor` never
opens the link, a walker test pinning that the default walk yields a
link and does not enter it while a `follow`ed link is walked after the
tree under one deadline, and a `list_dir` and grep test pinning
`rglob`/`os.walk` parity through a link.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed (CHANGELOG
`Unreleased / Fixed` entry)
## Risk
User-visible behaviour changes, all in tool output the model reads:
- `find` and `list_dir` (recursive) can now return a partial listing
with a `PARTIAL result` clause in the trailer where they previously
either returned everything or hung. The clause tells the model the
absence of a match is not conclusive and to narrow the search.
- A path-prefixed `find` pattern spends its budget only inside its
prefix, so on a large tree it finds what a root-anchored walk used to
miss.
- `find` refuses patterns containing `..` or starting with `/` with an
`Error running find:` line; `Path.glob` used to raise on the second and
could climb on the first.
- `find` with a trailing `**` lists files as well as directories beneath
the prefix; a trailing `/` lists directories only, as before.
- `find` reaches through a symbolic link to a directory where a literal
or single-wildcard component names or matches it, as it did at the merge
base; the earlier revisions of this PR had lost that and returned a
clean miss with no notice. `**` never enters a link, as before.
- A noise directory inside a `find` pattern's literal prefix, or named
as the `list_dir` path, is walked: `find('node_modules/*.js')` and
`find('src/node_modules/*.js')` answer its files and
`list_dir('node_modules', recursive=true)` lists it, where the merge
base answered nothing and "empty". One met below the prefix is pruned as
before. Both descriptions state the rule.
- Recursive `list_dir` on a workspace beneath a directory named like a
noise directory (`/tmp/build/proj`) lists it instead of answering "is
empty".
- The code-flow `glob` description, its `limit` parameter and the tool
guide tell a limit cut from a traversal-budget PARTIAL; the notices
themselves are unchanged.
- `list_dir` flat listings are unchanged; the empty-directory message is
unchanged.
Rollback: revert the squash commit. The new module has no other
consumers, and no state or schema is involved.
- [x] Security impact considered (a pattern can no longer climb out of
the fenced directory via `..`; a directory link is entered exactly where
`Path.glob` entered it at the merge base, one non-`**` component, and
never under `**`, so the fence's reach is what it was and not wider;
`list_dir` and grep never enter one)
- [x] Backward compatibility considered (the fork's trailer grammar is
extended, not changed; existing fork tests pass unchanged)
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
Three reports from acceptance testing, one branch. All three were
reproduced on a
real host before anything was changed, and the fixes were walked through
the same
host afterwards.
**Archiving did not hold, and the archive page did not show it.** Three
separate
causes:
- `session.archive` persisted by saving the whole session, which
rewrites the
metadata record from that process's copy of it. A page and a terminal
over one
home are two managers over one file: the other one had loaded the
conversation
before the archive, so its copy carried no `archived` key, and its next
save of
anything spoke for a flag it had never seen. The verb now appends the
one key,
the way the auto-archive pass already did. `append_metadata_patch`
reports
whether the patch reached a file, which is what lets the verb answer
`pending`
truthfully.
- The rail read that `pending` as a success, so a conversation with no
transcript
yet left the rail although nothing had reached the disk.
- The archive page asked `session.list` for fewer channels than the rail
lists, so
an archived scheduled run was invisible there and unreachable here.
**The usage page reported no data.** It read its range two ways. Calls,
cost and
the per-model table came from the daily telemetry files, dated per day;
the tool
table was topped up by reading session transcripts, and a transcript
counted as
in-range when its file mtime was. A conversation touched recently
therefore handed
the range every tool call it had ever made while its model calls, dated
per day,
stayed outside it -- thousands of tool calls beside no model calls at
all, which
reads as a page that failed to load. Telemetry has carried a row per
tool call for
a while, so the transcript fallback only ever covered older
conversations; dropping
it leaves one source and one reading of the range.
**A conversation now starts in the smart permission mode.** `ask`
stopped the agent
on every mutation, and a prompt answered by reflex is not a gate. Smart
is not the
weaker setting it sounds like: builtin denials and user deny rules hold
in every
mode, the reviewer speaks only for the ask tier, and a reviewer that
cannot run
leaves the call at the same prompt `ask` would have shown.
**Shared by the first two:** opening the settings dialog reloads the
config
snapshot, and neither the archive list nor the usage totals come from
it. Nothing
dropped them, so a dialog opened once held its first answers for the
life of the
page. Both are now cleared on open, which their own lazy loads already
key off.
**What this does not close.** `save` rewrites the whole metadata record
from one
process's copy of it, and this branch changes who can do that rather
than whether
it can be done. Archiving no longer erases what another writer added;
five other
verbs still can (pin, rename, the per-conversation model and permission
mode, the
ACP usage owner), and so does the turn path, which saves on every
message and is
the one a user actually hits. So a conversation archived from one client
and then
typed into from another still comes back.
Closing that needs `save` to stop speaking for keys it never touched,
and removal
is currently expressed by omission -- unpin, `title_auto` and
`output_limit_turn_at`
each delete a key by not writing it, so a merge on save would resurrect
them. They
have to become explicit false values first. That work is a round of its
own rather
than a fourth topic on this branch.
The ACP hosting pins the ask tier rather than inheriting the new
default: the
person there is in an editor watching an agent work on their checkout,
and the
prompt is how they see each write before it lands. The four other
products carry no
permissions block and were written as things raven dispatches rather
than things a
person drives, so they follow trunk.
## Type
- [x] Fix
- [x] Feature
## Verification
Backend, after the rebase:
```
uv run pytest tests/test_rpc_session.py tests/test_rpc_settings.py \
tests/test_rpc_config.py tests/test_config_live.py \
tests/test_rpc_contract_shapes.py tests/test_session_manager.py -q
# 498 passed
uv run ruff check raven tests # All checks passed
uv run ruff format --check raven tests # 1636 files already formatted
make check-source-language # pass
make check-large-files # pass
```
Frontends, after the rebase:
```
cd ui-web && npx vitest run # 189 files, 2592 passed
cd ui-web && npx tsc --noEmit # clean
cd ui-tui && npx vitest run # 144 files, 2074 passed
cd ui-tui && npm run type-check # clean
```
Every new or changed case was checked against the base revision with the
fix
removed, by restoring the file from HEAD rather than stashing, and the
files were
compared byte for byte afterwards:
| Case | On base |
|---|---|
| `test_archiving_keeps_a_key_another_writer_added` | fails: the foreign
`pinned` key is gone after the archive |
| `test_usage_counts_a_tool_call_on_the_day_it_was_recorded` | fails: a
transcript touched today adds two tool calls the range never saw |
| `opening again clears what the pages fetched for themselves` | fails:
both fields survive the reopen |
| `says it failed when the call answers that nothing was persisted` |
fails: `pending` is read as a success |
| `archived lists the archived sessions of every channel the rail shows`
| fails: the call carries no channels |
Real host, `raven serve` on a temporary `RAVEN_HOME` with real provider
credentials,
driven through the built page:
| Check | Before | After |
|---|---|---|
| Archive a conversation from the rail, then reopen Settings > Archive |
the list still shows the previous answer | the conversation is at the
top of the list |
| Telemetry rows on disk vs the usage page's call count, dialog reopened
without a page reload | 13 on disk, 12 on the page | 13 and 13 |
| Tool table against the `tool_call` rows for the range | inflated by
whole transcripts | `exec` 4, the number of rows |
| A fresh page with no `permissions` key in the config and no stored
pick | chip reads "ask" | chip reads "smart" |
| `mkdir -p /tmp/...` through `exec` on that host | approval dialog,
directory not created | reviewed and allowed, directory created |
The last row is the pair that makes the check able to fail: the same
command was
run with `permissions.mode` set to `ask`, and it stopped at the prompt.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
The permission default is the user-visible change: an install that has
never
written `permissions.mode` moves from being asked about every mutation
to having
the reviewer speak for the ask tier. Denials and deny rules are
unaffected, and a
reviewer that cannot run still leaves the call at the prompt. Anyone who
wants the
old behaviour writes `permissions.mode: "ask"`, and rolling the default
back is the
one literal in `PermissionsConfig.mode` plus the three places that
repeat it where
they cannot read it.
Usage numbers will change for anyone whose home has conversations older
than the
day telemetry started carrying tool rows: their tool counts drop to what
the range
actually saw. That is the point of the change, but it will look like a
loss.
`append_metadata_patch` gained a return value. The existing caller
ignores it, so
nothing else moves.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
The browser existed on every side except the model's: `raven/browser`
drives a
Chromium the panel streams over CDP, and `browser.*` RPC gives the
reader hands
on it, but `raven/agent/tools/` had no browser tool at all -- a model
asked to
open a page had nothing to call. This registers eight `browser_*` tools
over
that same driver, with no MCP hop, so the page the model drives is the
page the
panel shows and a human can take the keyboard mid-task.
Desktop control reuses `macos-mcp` through the MCP client that was
already
there; the only new code for it is a market catalog entry.
What the tools add beyond the driver:
- **Reading back.** Every acting call returns the page as it is
afterwards
(url, title, the actionable refs, the visible text), so the next call
can be
aimed without a separate read. `browser_screenshot` is the one that
costs an
image and is asked for on purpose; it goes out as an image block.
- **Who is acting.** Each call names an owner -- the sub-agent run in
flight,
else the conversation -- and the driver binds that owner to a tab. Two
agents
work in two tabs, neither can activate or close the other's, and a popup
a
click opens becomes the opener's tab. A reader's own clicks carry no
owner:
they are stamped, and the owner's next readback says the user touched
the
browser, once.
- **Permissions.** Reading and navigating default to allow, on the
`web_fetch`
reasoning (opening a page is a GET the agent could already make, and
`raven.browser.policy` refuses what a GET must not reach). Clicking,
typing
and pressing ask, keyed by site rather than by ref, so one approval
covers a
site for the conversation.
- **Config.** `tools.browser.headfulOnAgentUse` pops the shared browser
out
into a real window on the model's first use. Off by default: a server
has no
desktop to pop into.
The tool surface grew, so the `reserved_tools` tripwire moved:
descriptions
were trimmed first (~1270 to ~1090 tokens) and the bound raised from
6000 to
7400 against a measured 7115, with the trade written beside it. The
schemas are
only present where the browser extra is installed; without playwright
the tools
report themselves unconfigured and never reach the request.
No ui-web changes are in this PR. The web UI side of this work (a
browser pane
in the desk, a per-tab miniature, docking) is written against surfaces
that
`refactor/ui_web_architecture` removes, so it waits for that branch to
land.
## Type
- [x] Feature
## Verification
- `uv run pytest tests/ -q` -> 23755 passed, 121 skipped, 1 failed. The
failure
is
`test_cli_onboard_commands::test_clearing_does_not_disturb_a_key_the_user_exported_themselves`,
which reads the developer's own shell environment and fails the same way
on
an unmodified `main` in this checkout.
- `uv run pytest tests/integration/test_browser_tools_real_web.py -q` ->
6
passed against a real Chromium and a local form: fill and submit, a
screenshot arriving as an image block, two owners in two tabs with
neither
able to take the other's, a read leaving the front tab where the last
actor
put it, a `target=_blank` popup landing its opener on the new tab, and a
scripted model driving `AgentLoop`'s default tools end to end -- the
gate
asking once for the site, the grant covering the click that follows, and
the
panel's `browser.frame` returning the page the model left.
- `uv run ruff check raven tests`, `uv run ruff format --check raven
tests`,
`uv run lint-imports`, `make check-source-language`, `make
check-large-files`
-> clean.
- Desktop side exercised by hand through raven's own MCP client, over
stdio and
over streamable-http with a bearer token: launch Calculator, read its
accessibility tree, click 2 + 3 =, read the result back. Screenshots
arrive
as image blocks.
Not verified: the desktop flow was driven by a script rather than by a
model in
the loop; sub-agents that run in their own process (the ACP and cli
lanes) have
their own `Browser` singleton and are not given these tools; Windows and
Linux
desktop executors were not chosen.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
Notes. The acting verbs sit on the ask tier by default and a grant is
scoped to
a site and a conversation, so an approved click on one host does not
carry to
another. Navigation goes through the existing outbound policy. The
desktop MCP
server runs locally under `uvx` and needs macOS Accessibility and Screen
Recording grants, which the operating system asks for itself; the
catalog entry
is opt-in like every other market entry. Nothing here changes an
existing
default: without the browser extra the tools are absent, and with it the
only
new always-on cost is the tool schema.
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
The route from Raven-Design to the Raven-PPT template engine used to
open on the max tier alone. The same request then came back in three
unrelated styles across the tiers, and the top one was built on a
template the user never asked for. This PR moves the decision to the one
thing that actually calls for the engine: a .pptx the user handed over.
- **Route on an attached template.** `SubagentRouteConfig` gains
`needsFile` (a suffix), a third independent condition beside `needs` and
`minTier`. Raven-Design's route to Raven-PPT now declares `needsFile:
".pptx"` and drops `minTier: "max"`. Every tier designs its deck on
Raven-Design; the engine is reached only when a .pptx was handed over,
either a bundled template picked in the web UI (companion PR #573) or
one the user attached.
- **Handed over means attached in this turn.** A new `turn_attachments`
ContextVar is frozen beside `turn_tier` on the turn path. A direct
chat's media all count; a spawn or DAG node counts an attachment only
when its task text names that attachment's path or file name. Task text
alone never opens the route: a deck brief spells the deck's destination
path, the format in words, or a stray file in the directory exactly like
a template, and the first text-only scan sent a no-template run into the
engine on its destination path.
- **Tiers change effort, not product.** medium asks for low reasoning
effort, max for xhigh (the highest word a model may know; models that do
not know it fall back to their default), and the baseline inherits the
host's setting as before.
- **Design lane retries after streamed output.** `llmRetryAfterOutput:
true` on the design lane's defaults, matching the ppt lane. A max run
died at its thirtieth iteration to an upstream idle timeout after the
body had already streamed to the host; the lane now retries instead of
failing the turn.
- **Skill: use what the user handed over first.** Documents and data are
the material, pictures are the pictures, and an attached .pptx is the
engine's work, routed before the skill is read.
Docs: `CONTEXT.md` admission paragraph, `agents/README.md`, regenerated
`schemas/subagent.schema.json`.
Also removed: the engine's internal decision log
(`plugins-dist/ppt-engine/docs/ppt-raven-design.md`), a single-language
working journal for the team building the deck lanes that has no reader
in a public repository. The maintainer keeps it outside the tree; the
two code comments that cited it by path now state their reason in place.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run --frozen pytest tests/test_subagent_routing_backend.py
tests/test_agents_design_launcher.py tests/test_config_schema.py
tests/test_subagent_registry.py -q` -> 130 passed (after rebase onto
main).
- `ruff check` / `ruff format --check` on the changed Python files ->
clean.
- End to end on a full gateway: a high-tier request with a picked
template logged `classified for 'Raven-PPT'; routing there` and the
engine delivered a 20-page deck on that template in about 60 minutes;
the same request without a template logged `no .pptx the user attached
was handed over; running here` and stayed on Raven-Design. A brief that
only spelled the deck's destination path stayed on Raven-Design.
- Effort labels probed against `z-ai/glm-5.3-flash` over OpenRouter:
`low`, `high`, `xhigh` all accepted; `max` spent the whole output window
on reasoning, which is why the top tier is xhigh.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- User-visible: medium and high tier deck requests no longer differ in
product, only in effort; a deck on a template now requires attaching
one. A bound direct-chat handle to Raven-Design stays on Raven-Design
even with a .pptx attached (the route is evaluated at dispatch), a known
boundary.
- `needsFile` is additive; routes that do not declare it are dispatched
exactly as before.
- Rollback: revert the squash commit; no schema migration or storage
change.
- [ ] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
A campaign asked the shared rounds directory how much had been spent,
and the
directory answered for every job in it, including jobs its sibling
campaigns
had submitted. Rounds that keep one directory therefore bill each other,
and
the bill is cumulative: round three opens already charged for rounds one
and
two.
Measured on a run of 2026-09-11. Five campaigns declared the same rounds
directory. Round two had a budget of 130 and had actually used 34.6, but
the
eighteen jobs the earlier rounds had left in the directory brought the
reading
to 125.6, so the remaining 4.4 would not cover one more trial at 5.9 and
the
round stopped. 142 GPU-minutes went unspent and that round's multi-seed
conclusion was lost. A sibling run that gave each round its own
directory was
not affected, which is why this reads as a directory-hygiene problem
until you
look at the meter.
Two changes. Spend is now counted from the campaign's own ledger, so a
job a
sibling submitted is not billed here; the filter sits above the existing
timeline arithmetic, so same-device overlap is still charged once and
two
cards in parallel are still charged twice. And declare refuses a rounds
directory a live sibling campaign already keeps, naming the sibling, so
the
two rounds do not land in one directory in the first place.
Type: fix
Verification:
- All oncall tests: 775 passed, 1 failed. The one failure
(test_the_products_tool_face_equals_the_forks_config_intent, a missing
optional a2a_client dependency on this machine) also fails on 0464aa1b1,
so
this adds six passing tests and no new failures.
- The six new ones pin: a sibling's job is not billed; the campaign's
own two
trials overlapping on one device are still billed 20 minutes once; a job
this executor just submitted is billed before the ledger has caught up
(no
refund window); billing_only leaves a foreign backend untouched; declare
refuses a directory a live sibling keeps; a concluded sibling, and the
campaign itself, do not count as a clash.
- The first test also pins the measured number: the same fixture
directory
reads 125.6 unfiltered, which is 34.6 of its own plus 91.0 of its
siblings.
Risk: low for the meter, moderate for declare. The meter can only ever
bill
less than before, and a run that already gives each round its own
directory
reads the same. Declare now refuses something it used to accept, so a
caller
that deliberately shares a directory between live campaigns will see an
error
naming the sibling; concluded siblings and re-declaring the same
campaign are
both still fine.
---------
Co-authored-by: xiaotian.luo <xiaotian.luo@thetahealth.ai>
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
An on-call instance that finds its connection registry empty asks the
owner
for the machine. Until 2026-09-06 the host consumed that answer: a check
before
every spawn read the registry and, when it held nothing, ran
`raven ops connection add --non-interactive` from what the owner had
typed in
conversation. That check went with the pre-dispatch registry gate, and
the
plugin's own reply kept only half of the exchange -- it asked the owner
to run
the command themselves in a terminal. Measured 2026-09-20: the owner
answered
the question in the TUI and nothing wrote the row.
The write now belongs to the instance that needs the machine. A new
tool,
`ops_connection_add`, takes the owner's answer and files the row through
functions in the plugin's own registry module (`probe`, `write`,
`write_ssh_alias`, mirroring the CLI the way the reader already does).
The
machine is reached before anything is written; its cores, memory and
devices
are read off it rather than typed. All of it is in-process function
calls --
no `raven ops connection add` child process, no venv path to find.
The ask is cut to what only the owner knows:
- required: what they call the machine, whether it is this computer or
one
reached over ssh, and an address for the latter;
- port, username and key path are taken when given. Left out, `ssh -G`
resolves them the way the owner's own terminal would, and the keys it
names
are probed in turn, keeping the one that connects. A username ssh cannot
resolve is refused, not guessed;
- installed software, work directories and the budget unit are optional;
concurrency is kept only on a row that reports no cores or devices.
Only the on-call plugin (`agents/raven-oncall/plugins/oncall-flow`), its
prompt, the heat2d demo walk-through and tests change. No DAG, host or
dispatch code is touched.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `pytest tests/test_agents_oncall_flow_*.py
tests/test_ops_connections.py tests/test_cli_ops_connection_commands.py
-q`
-- 789 passed. Four new cases in
`tests/test_agents_oncall_flow_connection_add.py`:
a reached machine is written, listed by `describe()` and given an ssh
alias;
an unreachable one writes nothing; an ssh row with no address is refused
before any probe; a port/user/key the owner left out come from the
`ssh -G` resolution and the key that actually connected is the one
stored.
- `ruff check` and `ruff format --check` on the touched files -- clean;
`pre-commit run --files <touched>` -- all hooks passed.
- Unmocked, against a temporary registry file: `transport=local` on this
laptop reached it and read 12 cores; `transport=ssh` with only host,
port
and user given reached the 32-core box with the second of ssh's default
keys and read 32 cores / 232 GB; the same call with the user omitted was
refused (`Permission denied`) and wrote nothing.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- [x] Security impact considered -- the key path is stored, never the
key;
the model is told not to invent an address, port or key, and a row lands
only after the machine answered with that exact way in. The tool writes
one managed `Host <id>` block into `~/.ssh/config`, the same block the
CLI
writes today.
- [x] Backward compatibility considered -- the registry file shape is
unchanged; existing rows are not rewritten; a file with entries the
reader
skips is refused rather than rewritten without them.
- [x] Rollback path is clear for risky changes -- remove the manifest
row and
the tool module; the reader-side functions are unused without them.
## Related Issues
N/A
Co-authored-by: xiaotian.luo <xiaotian.luo@thetahealth.ai>
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
Raven-Research capped its replies at 30000 characters; every other lane
caps at
60000. The low number was vestigial, carried over from the vendored fork
rather
than chosen, and research writes the longest replies of the five. Raised
to 60000.
The branch briefly carried a run-once config migration (floor 10) that
lifted a
stored 30000 row to the new value on an upgraded install, added in
response to the
review finding that a stored row wins over the discovered manifest. It
was reverted
at the maintainers' request: no release has shipped, so there is no
upgraded install
with such a row, and the manifest change on its own is the whole fix.
The branch
diff against main is the one manifest line. A development config that
registered
the lane before this change keeps its stored `maxOutputChars` until that
row is
edited or removed (`merge_product_seeds` takes the whole stored row over
the
discovered one, by design).
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Head 5e0046413: the manifest change, a merge of main, the migration and
its revert.
```
uv run --frozen --python 3.12 --all-extras pytest -q tests/test_config_loader.py tests/test_agent_schemas.py tests/test_subagent_vendored_agents.py tests/test_subagent_acp.py tests/test_acp_modes.py tests/test_agents_research_flow_ask_user_surface.py
410 passed in 13.32s
uv run --frozen --python 3.12 --extra dev ruff check raven/config/loader.py tests/test_config_loader.py
All checks passed!
uv run --frozen --python 3.12 --extra dev ruff format --check raven/config/loader.py tests/test_config_loader.py
2 files already formatted
PYTHONPATH=. uv run --frozen --python 3.12 --extra dev python scripts/check_source_language.py origin/main...HEAD
exit 0
make check-commits
exit 0
git diff --stat origin/main...HEAD
agents/raven-research/subagent.json | 2 +-
git diff --stat dd8b58d2c HEAD -- raven/config/loader.py tests/test_config_loader.py
(empty: the revert leaves both files byte-identical to the pre-migration commit)
```
The type checker was not rerun locally: the revert removes code only,
and CI's
python lint job runs it on the head.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
A research reply between 30000 and 60000 characters now reaches the
caller whole,
costing that turn up to 30000 more characters of context. Rollback is
the one value.
A config that stored the lane's row before this change (development
installs only,
since nothing has shipped) keeps its stored cap until the row is edited
or removed.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
## Summary
#469 gave a bundled sub-agent nine verbs in place of six hook phases.
Reviewing it turned up a
list of things the contract said but did not yet do, and this PR closes
that list. No behaviour
change is intended: the point is that the same seam becomes something a
role can replace and
something a generated judgement can enter.
**1. The roles are named apart from the verbs, and `observe` is gone.**
`ActionModule.review`
and the participant's `review` were two different things a line apart.
The four delegating role
methods now say what they do -- they ask -- and the verbs keep their own
names, so `ask_review`
asks `review`. `observe` is removed: a verb with no return value decides
nothing and can only
keep state a participant is forbidden to keep. `outbound` says on its
own docstring that it is
the one verb with no role seat, and `StepView` gains `phase`, so a verb
asked at two moments
reads which one it is rather than inferring it from whichever other
field happens to be set
(`tools_ran` becomes a property derived from it, so the two cannot
disagree).
**2. The three verbs the seat was applying itself get a seat.**
`system_addendum`, `archive` and
`select_tools` were rendered straight onto the hook decision, so each
was the one judgement in
the set with nowhere to compose two participants, nowhere to vet what
came back, and nothing a
replacement role could decide. They join the other four:
`MemoryModule.ask_system_addendum` / `ask_archive` and
`CapabilityModule.ask_select_tools`. The
seat is not the point where narrowing takes effect -- `select` still is,
and the registry still
adjudicates every call -- so a participant narrows after the product has
spoken and never instead
of it.
**3. A participant answers with plain data.** `review`, `intake` and
`system_addendum` returned
host classes (`Verdict`, `Intake`) and `salvage` returned `Any`.
`Accept`, `Resample`, `End` and
`Intake` are now builders returning plain mappings, the host reads one
back with `read_verdict` /
`read_intake`, and an answer it cannot read is silence rather than a
refusal. That is what makes
the third invariant real and what lets a judgement compiled from source
answer the same verbs a
plugin does -- it can build a `dict`; it cannot build a host class.
**4. A dispatch's judgements are a participant.** `judge` was the one
verb a role answered by
reading the dispatch's own `checks` and `code` for itself. A Charter now
enters as a participant
like any other, `ActionModule.ask_judge` takes the list, and the merge
is a veto so the first
refusal decides. The participant list becomes the only route an external
judgement takes, which
is the thing step four needs: a judgement generated for one dispatch
joins the same list without
a second way in.
**5. The rename.** `AgentConduct` is `AgentParticipant`,
`contracts/agent_conduct.py` is
`contracts/participant.py`, `agent/hook/conduct.py` is
`agent/hook/participant.py`, and
`agent/harness/conducts.py` is `agent/harness/participants.py`.
"Conduct" was already taken in
this tree -- raven-code's Coding Conduct prompts are a different thing
-- and a reader hitting both
had no way to tell them apart. The rename was done symbol by symbol, not
by search and replace,
for exactly that reason.
**7. Review (LivXue, at 3a1bf07c).** The `judge` disclosure had reached
two of its four homes;
the other two are `ActionModule.ask_judge` on the paper and
`DefaultAction.ask_judge`, and they
survived because they phrase the claim without naming any symbol the
earlier fix touched. The test
meant to pin that claim could not fail for the reason it was written --
it asserted the refusal
rather than the argument, and built a `ParticipantHook` it dropped --
and now asserts what the
registry hands the role, mutation-checked by wiring a participant
through. `compose_judge`
exploded a one-sentence `str` refusal into one refusal per character,
because `str` satisfies
`Sequence[str]` structurally; `charter_code.run_judge` coerced it where
this composition used to
live and the handling did not move with it. Two records corrected: the
type-only
`raven.contracts` -> `raven.agent` edge, the first in the tree and the
price of moving `Verdict`
and `Intake` off the paper, is now written beside the import contract it
bends rather than left to
be discovered; and the ledger entry for the 3,200 -> 3,410 bump is
restored to the names and count
it was written with. Not taken: reading `step.phase` at
`research_flow/flow.py:1000` -- the gate
chain's phase vocabulary and `StepView.phase` coincide on
`after_iteration` only, and that call
site wants `before_execute_tools`, which is the key `_phase` dispatches
on.
**6. What the paper was claiming and not doing.** Read back over the
seam afterwards rather than
over the diff. ``judge`` read as though a plugin's override were asked
ahead of a dispatch's own
rules; it is not, and cannot be as written, because the party that asks
the verb is
``ToolRegistry.execute``, which is not the hook chain and holds no
handle on this turn's
participants. The merge order is real; nothing puts a plugin in the
list. Wiring one through is a
turn-scoped register this change does not add, and it would start
refusing calls that run today,
so it is named on the paper and pinned by a test instead.
``max_iterations`` had lost its
docstring to the property inserted between the field and the string
documenting it. No executable
line moves in this commit: the module's AST, docstrings stripped, is
identical to its parent's.
CONTEXT.md's entry is rewritten to the end state, including the two
kinds of role method, the two
verbs that are exceptions, and the note that the Coding Conduct prompts
are unrelated.
One item from the same list is deliberately not here: a `planning.*`
block on the dispatch
parameters. It is not a contract closeout but a new model-facing field,
and it needs the
generator's schema and prompt to move with it.
Contract papers: `participant.py` and `harness.py` are both factory-loop
tier, so the
contract-tier digest and `CONTRACTS_VERSION` do not move.
`CONTRACTS_LINE_CEILING` 3,440 to
3,470 to 3,500 to 3,540 to 3,550 to 3,570, each bump with its own review
paragraph in
`tests/test_kernel_budget.py`. The chain was recomputed after rebasing
onto #410, which added
seven lines to `loop_hooks.py` inside the old headroom and left one
commit here with one line of
it; every "Measured at" figure in that file is the count at that commit.
## Type
- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [x] Refactor
- [ ] Other
## Verification
Gates, run at each of the seven commits:
```
uv run ruff check --no-cache raven evolver agents plugins-dist tests scripts
uv run ruff format --check --no-cache raven evolver agents plugins-dist tests scripts
uv run lint-imports
uv run pytest -q
npx commitlint --from origin/main --to HEAD --config commitlint.config.cjs
uv run python scripts/check_commit_messages.py origin/main..HEAD
uv run python scripts/check_source_language.py origin/main..HEAD
uv run python scripts/check_large_files.py origin/main..HEAD
```
Import contracts: 10 kept, 0 broken. The suite is green: the failures
this machine shows are the
same ones it shows on an unmodified `main` in the same worktree layout
(missing browser and
optional packages), and this branch adds none.
Behaviour preservation. The oracle is the hook seam itself. `main` and
this branch were run under
the same scripted provider, outputs normalised for nonces and temp
paths, then byte-compared.
Four scenarios, all identical:
- the five-plugin hook seam, every phase's decision and metadata per
iteration (23,840 bytes)
- a whole turn with no playbook: host turn, spawned sub-agent, tool
calls and refusals
- a playbook-on worker lane in process, including the charter refusals
- six window-shrink scenarios
This is the seam the change is about, and identical output across it is
what "no behaviour
change" means here -- it is not a claim about paths the four scenarios
do not reach.
Two claims had no assertion anywhere and now do. ``phase``, and the
``tools_ran`` derived from
it, are what three of the five bundled plugins branch on -- ppt on its
close, oncall on its
counter, research on which gate runs -- and a mistyped phase string at
one of the six call sites
would have changed what they do with a green suite. The read-only test
now also covers
``mode_overlay``, the one frozen field it skipped. All three assertions
were mutation-checked:
mislabelling a phase, deriving ``tools_ran`` from the wrong one, and
dropping the freeze each
turn exactly their own test red.
New tests, each written against a claim the contract now makes rather
than against the code:
a participant cannot write through the `StepView` it is shown; an answer
the host cannot read is
silence, not a refusal; a participant that answers with a mapping it
built itself is understood;
every verb with a seat goes through its role rather than around it,
asserted as a set so a new
verb that bypasses its role fails; two seats in one chain each keep one
addendum; two turns in
flight keep their own participants; a bound role decides what a
participant's verdict does; a
plugin's own judgement speaks before the dispatch's, and a silent
participant lets the next one
speak.
Real model, Sonnet 4.5 through OpenRouter, on this branch: a query
generates a playbook, two
sub-agents are instantiated and run, each writes its `summary.md` under
its own fence, and both
results are announced back to the originating session.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
For plugin authors: the six-phase `AgentHook` is untouched and a plugin
shipping one keeps
working. A plugin written against #469's `AgentConduct` needs the new
names and, if it answered
with `Verdict` or `Intake`, the builders instead -- the five bundled
plugins are ported here and
are the worked examples.
One verb narrowed, and silently for a plugin that used the width.
`salvage` was annotated
`Any | None` and `compose_salvage` returned whatever was not None; it is
now `str | None` and only
a non-empty string is taken. A third-party plugin that salvages with a
reply object rather than
text stops being heard rather than raising -- which is the third
invariant working as written, and
worth knowing before upgrading. The narrowing is deliberate: `salvage`
answers the text a turn
sends when it produced none, and `Any` was not a contract.
For anyone replacing a harness role: the four delegating methods are
renamed and four more are
added, so a replacement written against #469 needs them. `bind()` names
the missing member at
assembly rather than failing inside a turn.
Rollback is a revert of the merge commit. Nothing persisted on disk
changes shape.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
Follows #468 and #469.
Generated with Claude Code (https://claude.com/claude-code)
---------
Co-authored-by: yao pengfei <yaopengfei@shanda.com>
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
Two regressions in the hand-built deck lanes (medium and high on
Raven-Design), and the stream failure that made every run of them a coin
toss.
**The deck lane draws its own pages again.** PR #451 pointed the
hand-built lane at the engine's helper modules (`ppt_layout`,
`ppt_theme`, `ppt_shapes`), which were written for the max lane's script
backend. Their defaults became the deck: `heading()` put a white surface
band bled across every page, `card()` became the way anything was
placed, text frames were top-anchored with the lower third empty, and a
build script named three colours. Measured on the same request, the
accent colour appeared 8 times across 20 pages. The skill, route note
and assets reference go back to the pre-#451 text: the lane draws with
python-pptx and takes only the icon set, `add_formula` and `math_runs`
from the engine. On the reverted lane the accent appears 54 times, the
deck carries 12 real pictures and the layouts differ page to page.
**Colour is named beside the type sizes.** The skill listed sizes for
every role and said nothing about colour, so a lane with the right
palette still drew in one colour. One paragraph now says what colour is
for; the layouts note no longer reads as one accent per page, which a
lane took as a ceiling. Where `image_search` is not offered, the
fallback no longer tells the lane to give the pictures up: `web_search`
for the page, `web_fetch` it, and download where the fetch backend keeps
image links.
**A stall in a silent think is asked again.** Across two measured runs
the lane's turn failed 28 times on `Upstream idle timeout exceeded`,
every time in the one round that writes the whole build script into a
tool argument. `stream_llm_call` refuses to retry after output a watcher
has seen, and counted reasoning deltas and half-built tool-call
fragments as that output, though neither is ever shown as the reply. So
the configured retry ladder was never reached. `rendered()` now asks
what a watcher could have seen; every retry path resets the buffers
first (a slot left standing merged with the next attempt into a call the
model never made); a stall handed back as an error response carries the
usage it spent. The in-process builtin backend, whose comment claimed a
retry ladder and passed none, now receives the deployment's
`llmErrorRetryDelays` and `llmRetryAfterOutput` through the
SubagentManager. No packaged product takes that path; all five run as
ACP agents on the loop's own call site.
**Two bundled templates edited in place**, by the maintainer's word.
`beige_geometric_general_report` loses its page 20, a dark photograph
cut by a circle under pale rounded cards; 23 pages become 22 and the two
reference pages the lane borrows from it (17, 19) keep their numbers.
`black_circuit_tech_launch` loses the 27 percent circuit texture on its
master and the photograph on its Section Header layout, so its body and
section pages sit on the master's plain `#000000`; cover and closing are
unchanged. `templates.manifest.json` is repinned; `fetch_templates.py
--verify` holds all ten pins. The registry archive was not re-cut.
No configuration default changes. The only behaviour every lane sees: a
stream that fails before any reply text reached a watcher is retried on
the configured ladder instead of failing the turn.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
```
uv run --frozen pytest tests/test_agent_loop_llm_error_patience.py tests/test_agent_loop_stream.py \
tests/test_subagent_manager.py tests/test_subagent_routing_backend.py -q
265 passed in 6.85s (after rebase onto main)
uv run --frozen pytest tests/test_litellm_provider_stream.py tests/test_litellm_provider_stream_end.py \
tests/test_provider_stream_fallback.py tests/test_providers_stream_idle_budget.py -q
102 passed
uv run --frozen ruff check raven/agent/loop/main.py raven/agent/subagent/backends/raven_loop.py \
raven/agent/subagent/manager.py raven/providers/streaming.py
All checks passed!
grep -nP "[^\x00-\x7F]" agents/raven-design/route-raven-ppt.md -> no matches (the note is pinned ASCII)
```
Both new tests were checked against the unfixed code:
`test_a_stall_during_a_silent_think_is_asked_again` fails with the old
`emitted` test, and
`test_what_the_failed_attempt_left_behind_is_dropped` fails with the
buffer resets removed.
The failure itself was reproduced outside the runtime: the same
37-message history, six pictures and tool table, sent through litellm
1.101.0 to the same vendor, succeeds on a short answer every time and
fails mid-stream one time in three when asked to write the full build
script; healthy long streams show a maximum inter-chunk gap of 1.9s over
234s, so the cut is a dropped connection, not a slow model.
Decks built on the changed lane, same request as the #451 acceptance run
(glm-5.3-flash via OpenRouter): medium 21 pages with 12 pictures and 7
text colours, 48 gate findings (4 `excessive_whitespace`, down from 18);
high 13 pages with 13 pictures and 9 text colours, 37 findings. The high
run's page count came from the host agent's forwarded brief, which
stated 10-14 pages the user never asked for; that is a separate issue.
Template edits: `tests/test_ppt_engine_templates.py
tests/test_ppt_engine_default_templates.py
tests/test_ppt_engine_template_bands.py
tests/test_ppt_engine_template_theme.py
tests/test_ppt_engine_measure_geometry.py` -> 152 passed, 1 skipped;
`make check-large-files` -> clean; both templates rendered and read page
by page.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
- [ ] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
User-visible: on every lane, a streamed call that fails during reasoning
or mid tool-call, with no reply text yet shown, waits out the configured
ladder (default 15/30/60s) and asks again instead of ending the turn. A
call that already streamed reply text behaves as before. Reasoning
tokens of the abandoned attempt are spent again and are now recorded in
usage. Rollback: revert the `providers` commit alone to restore the old
failure; the skill text and the builtin-backend plumbing are independent
of it.
## Related Issues
N/A
## Summary
`failure_class` keys the loop's tool-failure streak on an envelope's
`error`
string alone. That works only while the string comes from the small
fixed
vocabulary its producers are meant to keep, and it is a convention the
module
cannot enforce - the docstring added in #410 names exactly this failure
mode:
one cause counting as many.
Every media tool broke it. `_format_http_error` interpolated up to 400
characters of vendor body (which carries a request id) into `error`; the
unreadable-reference handlers interpolated the path; the four catch-alls
put
`str(e)` there, which spells the host. So a dead endpoint produced a
class per
call, `(tool, failure_class)` never repeated, the streak never reached
`_LOOP_BREAK_THRESHOLD`, and the stop-repeating nudge was unreachable
for
`image_generate`, `text_to_speech` and `video_generate` alike.
The URL gate in front of `web_fetch` had it too, in both copies of the
tool:
most reasons `validate_url_target` composes name the address they
refused, so
a model walking an internal range got one class per address. #410 fixed
the
handlers behind that gate and left the gate itself.
`error` now carries only what a reader could enumerate. The variable
part moves
to `detail`, which keeps it in front of the model and inside
`is_hard_tool_failure`'s transient-marker scan. Where the split gave the
single
call a further key, the batch reducer forwards that too: `hint`, which
names the
proxy a 403 can be routed through, and `url`, which names the reference
a
guarded fetch refused. A batched picture is told what the single call is
told,
which is the property the split has to preserve. Distinct causes stay
distinct,
which is the failure mode this trades against: two HTTP statuses, two
exception
types and the four vendor refusals each keep their own class, and the
tests
assert that direction too.
Found by sweeping for the shape rather than by reading the code: every
`"error":` whose value is not a literal is a candidate, and that grep is
the
cheapest guard against this recurring.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run pytest tests/ -q -p no:randomly` -> 23443 passed, 109 skipped
- `make lint-python` -> ruff check and format clean
- `make lint-types` -> all checks passed
- `make lint-imports` -> 10 contracts kept, 0 broken
- `make check-source-language`, `make check-large-files` -> clean
- Revert-to-red, per fix, restoring the source from a backup afterwards:
reverting `media_gen.py` alone turns the four new class tests red and
leaves
`test_two_different_statuses_stay_two_classes` green; reverting either
copy
of `web.py` turns only that copy's gate test red and leaves the two #410
streak tests green. For the batch fold, each key is pinned on its own:
reverting it to `detail` alone turns both new batch tests red, restoring
`hint` alone leaves the reference test red, restoring `url` alone leaves
the
403 test red.
- After rebase onto 45203a4a6: `uv run pytest
tests/test_media_gen_tool.py
tests/test_security_web_ssrf.py -q -p no:randomly` -> 100 passed;
`make lint-python`, `make lint-types`, `make check-source-language`,
`make check-large-files` -> clean.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
Tool output shape changes: a caller reading the reason out of `error`
now
finds it in `detail`. The readers in this repo are the model itself and
the
tests updated here; `tests/test_security_web_ssrf.py` is the one
behavioural
assertion that moved, and it still pins that a private address is
refused for
being private. Rollback is a plain revert of this commit - no state, no
migration, no config.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A. Finishes the envelope work started in #410, which fixed the
reader's
handlers and left the gate in front of them and every media tool.
---------
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## What
Two defects in the shipped `agents/raven-code` profile, both inherited
from the retired vendored twin's comparison hygiene and both silent at
runtime.
**The skill route was advertised but dead.** Trunk's skills are
pull-discovery: a name+description menu rides the user envelope, and its
footer tells the model, verbatim, *"Read one with read_skill(id); search
differently with find_skill"* (`raven/context_engine/scent.py`).
raven-code kept `read_skill`, `use_skill` and `find_skill` in its
disable rows, so the menu taught a route that answered "unknown tool" --
while the router still ran, retrieval still happened, and every body it
fetched was dropped unread, with nothing logged to say so. All three
tools register off the skill registry alone
(`raven/agent/loop/wiring.py`); a Hub endpoint only adds their `hub/`
branch, and `hub` itself stays disabled.
**Memory was double-off.** design, oncall, ppt and research all ship
`memory.backend: "everos"`; raven-code alone shipped backend `null`
**plus** the `everos-memory` plugin opt-out -- the one shipped agent
that could not remember. The identity was already `raven-code` in all
three places (`memory.userId/agentId`, the plugin slice,
`subagent.json`); only the two off-switches go.
The redundant `skillForge` block goes too: its two knobs
(`rewriteEnabled`/`llmGateEnabled`) are only built under push discovery
(`factory.py`), which no shipped agent runs, and the other four agents
carry no such block.
**Review follow-up (second commit):** enabling everos-memory also offers
the plugin's `understand_media` tool through the entry-point lane, which
the hermetic face fixture cannot see -- an unledgered 14th tool in
production. Same remedy as the playbook rows that board past the fixture
the same way: the disable row is the pin, and `PLUGIN_LANE_WITHHELD`
puts the lane on the ledger. raven-research holds the same line; design,
oncall and ppt serve the tool deliberately.
## Fleet posture after this change
| | everos | read/use/find_skill | skillForge block |
|---|---|---|---|
| design / oncall / ppt / research | on | design serves all three | none
|
| **raven-code (before)** | **double-off** | **all three disabled** |
explicit false/false |
| **raven-code (after)** | on | all three served | none |
## Tests
The tool face moves on its ledger, not by luck
(`tests/test_agents_code_launcher.py`): `SKILL_LANE_TOOLS` joins the
face arithmetic, `find_skill` leaves `TRUNK_NEW_WITHHELD` (five stay
withheld), `PLUGIN_LANE_WITHHELD` pins the plugin lane, and the everos
posture test is rewritten from *stays-factory-off* to *ships-on*. The
face itself is hermetically rebuilt from the render: 13 tools = the
previous 10 + the three skill tools, verified by name and schema.
- `tests/test_agents_code_launcher.py`: 70 passed
- reviewer's set (`test_agents_code_launcher` +
`test_agent_loop_skill_tools` + `test_context_scent` +
`test_everos_plugin_discovery`): 110 passed
- ruff check + format: clean
---------
Co-authored-by: litong <238663200+TongLi31@users.noreply.github.com>
## Summary
Absorbs the first of two remaining commits from the research fork before
it stopped
iterating. This one lands instruments only: nothing here changes what a
shipped run does,
and the research flow label does not move because no model-visible text
changed.
`raven/agent/loop/dead_end.py` (new) asks whether a finished turn ended
on the model's own
prose. The test is structural, with a textual sub-label for the tail
shape. Three decisions
are worth review:
- It lives under `raven/agent/loop/` rather than in the research plugin,
because the loop
is what would re-run a dead turn, and a host module cannot import a
plugin without
breaking `make lint-imports`.
- The ask labeller is injected (`ask_kind`) rather than imported,
because only the product
that writes the harness asks knows how they are worded. With no labeller
the failure mode
is still recognised structurally and reported as `harness_ask_unknown`,
so the boolean
never depends on wording.
- The fork marked its injected turns with a key of its own. This loop
already had an
equivalent in `_HOOK_INJECTED_KEY`, so the predicate reads that rather
than adding a
second marker for the same fact.
The conditional rerun that reads the predicate arrived on this branch
afterwards, in
#418, along with the turn's wall clock. Both are supplied as data a hook
writes onto the
turn's metadata rather than as config the loop reads, so an agent whose
hooks leave no
budget runs exactly as it did before either existed: the rerun is
unreachable for it and
the clock is never consulted. The rerun starts from the original
question rather than
salvaging the failed attempt, because salvage was measured on 25 real
duds to produce
content 23 times and the right answer none of them, turning a detectable
zero into a
confident wrong answer.
Three defects in that work were found by review and fixed on this
branch, each with a
reproduction that is red on the commit before it. The loop numbered
episodes from an
iteration count that restarts, so a rerun emitted indices [0, 1, 2, 0]
and the TUI, which
keys episode rows and their fold state by that index, had the rerun's
first step collide
with the first attempt's. Each attempt took its own clock reading, so a
first attempt
ending just under the limit handed the rerun a fresh full budget and a
ten-second turn ran
to eighteen. And the research hook opens its per-turn ledger at
iteration 1, which a rerun
reaches again, so the second open replaced the path the close reads and
left the first
attempt's file unreachable on disk.
Reading that back afterwards turned up three more, none of them raised
in review. The
turn's end record carried the attempt's iteration count beside the
turn's elapsed time
with nothing saying which was which, so it gained ``attempt``. The hook
contract described
that record as "status and iteration count" while it carried five
fields, which hid
``stopped_by`` from anyone writing a terminal gate against the contract.
And the rerun's
progress line named research in a loop that serves every agent, and
called itself the
first attempt when the budget allows more than one.
A verbatim body sink (`RAVEN_VERBATIM_SINK`) records search and fetch
results at three
chokepoints. It is a second file rather than more columns on the ledger
because a 250 KB
row would leave no complete line in the 64 KB tail window
`_resolve_session_seq` reads,
which would silently reset the re-run split. Off unless the environment
names a file, and a
write failure is logged rather than raised.
`DigestOutput` lets a digest return a write-only ledger annotation
beside its text. The
annotation is stripped from the tool result and merged into the fetch
row, so a digest can
never label its own output where the model can read the label. Nothing
emits one yet; this
is the pipe a later digest sidecar uses.
`is_hard_tool_failure` was blind to the whole reader path. `web_fetch`
never returns a bare
string, it returns a JSON envelope, so a spent quota, a rejected URL and
a failed
validation all read as success and reset the streak `web_search` had
accumulated.
Transient markers are still tested first, so a 429 inside an envelope
stays retryable.
Forced finalize now books its own salvage spend. The phase fires on
every run that produced
no answer and burns up to `max_tokens` doing it, and it was counted
nowhere.
The Chinese refusal opener lives in `raven/i18n/zh_lexicon.py`, which is
the exemption zone
this repo keeps Chinese forms in, and the predicate imports it from
there rather than
carrying a literal outside the zone.
Two defects found in the first review round are fixed on this head, both
reproduced before
being changed.
The verbatim sink borrowed the ledger's `_resolve_session_seq`, which
recovers the re-run
split by reading the last 64 KB of the file and parsing the last
complete line. That works
for the ledger because its rows are small; this sink stores the large
ones, so the first
record wider than the window leaves nothing parseable and the sequence
resets to 1, making
two runs indistinguishable. Runs are now told apart by a tag minted in
memory once per
process and never recovered from disk, which removes the read a large
row defeats. The
argument for keeping this file separate from the ledger was already in
its docstring; it
applies to the sequence too, and now says so.
`is_hard_tool_failure` started counting JSON envelopes while
`failure_class` still read
them as undifferentiated text. The streak key is `(tool, failure_class)`
and the break
threshold is two, so a blocked URL followed by a reader's HTTP refusal
fired the
stop-repeating nudge at a model that had changed both its cause and its
approach. Both
predicates now share one envelope parse, and an envelope is classified
by its own `error`
string rather than by a textual ladder that cannot see into one.
Coarseness is for model
prose, which varies without meaning anything; a tool writes its error
from a small fixed
vocabulary, so equal strings are the same failure and different ones are
different. The
parts that vary with the page travel in the envelope's other keys, so
they cannot split a
streak.
The last commit removes an `isinstance` guard in the envelope reader
that the diff-coverage
report flagged as the only uncovered changed line. JSON has one shape
that opens with a
brace, so the branch was unreachable; removed rather than covered.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Run at this head (95c975b3), on `origin/main` with nothing to rebase
onto.
```
uv run --frozen --python 3.12 --all-extras pytest -q tests/
22132 passed, 43 skipped, 109 warnings in 388.67s
```
Integration and e2e are deselected by default (`-m "not integration and
not e2e"`), so the
run above does not include them. This change adds no integration
surface.
```
make coverage
make coverage-ratchet
line current=88.66% baseline=87.30% delta=+1.36pp
branch current=81.59% baseline=79.43% delta=+2.15pp
Coverage ratchet passed with 0.05pp tolerance.
make coverage-baseline-check
Coverage baseline update is monotonic.
COVERAGE_BASE_REF=origin/main make coverage-diff
Diff coverage: 100.00% (126/126 executable changed lines)
```
Diff coverage reported 99.21% on the commit before last, with one
uncovered changed line:
the sentence the rerun says to the reader, which no test drove because
none passed an
`on_progress` into a retrying turn. The last commit pins it rather than
waiving it.
```
make lint-python
All checks passed! / 1946 files already formatted
make lint-imports
Contracts: 10 kept, 0 broken.
make lint-deps
Success! No dependency issues found.
make check-source-language
clean
make check-large-files
clean
make check-commits
clean
```
The kernel budget gate caught one thing worth naming: documenting the
turn-end record in
the hook contract put `raven/contracts` at 2808 lines against a ceiling
of 2791. The
per-field detail moved to the write site in `turn_path`, which is not
budgeted, and the
paper now names the fields and says where the rest is. `raven/contracts`
is at 2788.
Each of the three review fixes was proved against the commit it fixes
rather than
reasoned about: a detached worktree at that commit, the new tests copied
in, red there and
green here. They reproduce the reviewer's own numbers -- the episode
list `[0, 1, 2, 0]`,
the eighteen seconds, and the stranded ledger file. The strengthened
comparison in
`test_the_retry_starts_from_the_question_not_from_the_wreckage` is a
tightened guarantee
rather than a regression test and passes either way, which is why it is
called out here.
`agents/raven-research/.env` was moved aside for every suite run: it is
gitignored and
absent in CI, and two launcher tests that delete a key from the
environment otherwise find
one in the file.
This machine has no search-provider key, so no research brief can
actually be run here.
The retrieval-path changes are verified by unit tests only, which is why
the three
chokepoints are pinned by tests that assert both the presence and the
absence of a row
rather than by an observed run. The same limit applies to the rerun: the
clock and the
dead-end trigger are driven by a deterministic clock in tests, never by
a real turn.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No user-facing surface changed, so there is nothing to document. The one
operator-visible
knob, `RAVEN_VERBATIM_SINK`, is an instrument that is off unless set and
is documented in
the module that reads it.
## Risk
The `is_hard_tool_failure` change is the only unconditional one, and it
reaches every agent
rather than just research: any tool returning a JSON envelope with a
non-empty top-level
`error` now counts toward the tool-failure streak that triggers the
change-approach nudge.
That is the intended correction, and the direction is conservative
because transient
markers are still tested first. Reverting it is a single branch.
Everything else is inert by default. The body sink writes nothing unless
the environment
names a file. `DigestOutput` has no emitter in this change, and a digest
returning a plain
string produces the same envelope it always did, which
`test_a_bare_string_digest_still_works` pins.
The dead-end predicate now has a caller, and it reaches only an agent
whose hooks write a
budget onto the turn's metadata. No agent on this branch does:
`agents/raven-research`
ships `wallClockSeconds` and inherits the rerun from its plugin's class
default, and every
other agent leaves the key unwritten and is bounded exactly as before.
The turn's overrun
is one budget plus at most one iteration, because the clock is read
between iterations and
never mid-generation: cancelling a call in flight would discard a
finished generation and
leave no answer at all. Rolling the rerun back is the budget key;
rolling the clock back is
the same.
Rollback is the whole commit; nothing here is depended on by anything
already on main.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
Co-authored-by: KT <74288668+0xKT@users.noreply.github.com>
## Summary
Follows #468 (merged as `869ad78a`), which moved the charter reads and
the window's mid-turn shrinking onto the harness roles. This branch is
rebased onto `main` and carries only its own three commits.
A sub-agent's product logic was an `AgentHook` subclass: six phase
methods over a fourteen-field context it could write, with the turn's
own state kept in the context's free-form `metadata` dict. Surveyed
before this change, the five bundled plugins had 71 phase methods, 42 of
them doing real work, reading fourteen context fields and using six
decision fields. Every one of them fits a small set of verbs. This PR
makes those verbs the contract, in three commits.
**1. A sub-agent writes a conduct instead of six hook phases.** New
factory-loop-tier paper `contracts/agent_conduct.py`: `AgentConduct`
with nine optional verbs (`intake`, `select_tools`, `advise`,
`system_addendum`, `review`, `salvage`, `outbound`, `archive`,
`observe`), answered against a read-only `StepView` of fourteen fields,
with `Intake` and `Verdict` (Accept / Resample / End) as the answers and
a `ConductFactory` because the host builds one conduct per turn.
It sits beside `loop_hooks` rather than replacing it. The six phases
remain the loop's *timing* contract: when the loop asks, in what order,
what a refusal does. This is the *judgement* contract: given one step,
what does this agent say about it. `ConductHook` seats one in the other,
so a plugin that still ships a plain `AgentHook` keeps working and the
composite's ordering, merging and rollback are untouched.
All five bundled plugins are ported: design-engine, ppt-engine,
code-flow, oncall-flow and research-flow. Research keeps its six-phase
gate chain: the gates now subclass a plugin-private `Gate` and read a
`GateCtx` the conduct builds from its `StepView` and its own
turn-private facts, so six thousand lines of gate bodies did not move
and its wrappers still see the cross-gate state they read.
The turn's conduct and the system-message addendum it splices live in
the turn's own `metadata` dict, not on the hook: one hook instance
serves every turn a process runs, and a system turn can overlap a user
one on the same chain.
**2. The conducts seat on the roles.** `MemoryModule.intake`,
`PlanningModule.advise`, `ActionModule.review` and
`ActionModule.salvage` each take this turn's conducts, so a replaced
role decides what a plugin's judgement does rather than the seat
deciding it. The composition rules live in
`raven/agent/harness/conducts.py`: the first non-Accept verdict wins,
advice joins in order, the first salvage wins, an intake threads the
text through each conduct. `run_turn` binds the harness for the turn the
way it binds the model, and the seat falls back to the same rules when
nothing is bound, which is how a plugin test drives a hook directly.
Contract papers: the conduct paper is factory-loop tier, so the
contract-tier digest and `CONTRACTS_VERSION` do not move with it.
`CONTRACTS_LINE_CEILING` 3,200 to 3,420, each bump with its own review
paragraph in `tests/test_kernel_budget.py`.
**3. What the review found.** Eleven threads, all resolved in the third
commit. The ones that changed behaviour rather than prose:
`CodeFlowHook` kept its `rolls_back_iterations = False` (inheriting
`True` from the new base had it hold every reply behind the draft gate
instead of streaming); `StepView` now publishes deep-frozen nested
values, since freezing only the outer tuple left a conduct able to write
through to `ctx.messages`; a turn's conducts are collected at the role
boundary, so a replaced role sees one batch of the turn's judgements
rather than one call per seat; an addendum is located by its own text
rather than a saved offset, which two conducts appending system text
used to shift out from under each other; `Planning` and `Action` gained
binders, so a replacement role missing a new member is named at assembly
rather than swallowed by the composite's `except Exception`.
`CONTEXT.md` carries the Agent Conduct term and the Agent Hook entry no
longer describes what this PR replaces.
## Type
- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [x] Refactor
- [ ] Other
## Verification
Gates. CI runs these at the branch tip (17 pass, 1 skipped -- the
skipped row is the disabled Claude Mention workflow). Locally, at each
of the three commits:
```
uv run ruff check --no-cache raven evolver agents plugins-dist tests scripts
uv run ruff format --check --no-cache raven evolver agents plugins-dist tests scripts
uv run lint-imports
uv run pytest -q
npx commitlint --from origin/main --to HEAD --config commitlint.config.cjs
uv run python scripts/check_commit_messages.py origin/main..HEAD
uv run python scripts/check_source_language.py origin/main..HEAD
uv run python scripts/check_large_files.py origin/main..HEAD
```
Import contracts: 10 kept, 0 broken at each of the three commits. The
suite is green at each, and no commit adds a failure that `main` does
not already show on this machine (this checkout has the heavy extras
uninstalled, so the local run carries failures `main` carries too -- CI
is the authority, and it is green). The loop's own e2e files, which the
default selection leaves out, were run too (charter, playbook,
truncation, direct chat, fallback chain, ACP stdio): no new failure.
Behaviour preservation. The oracle for this change is the hook seam
itself: all five plugins driven through every phase of a multi-iteration
turn under the same scripted provider, recording each phase's decision
and the observers it files. Outputs normalised for nonces and temp
paths, then byte-compared.
Re-run after the review fixes at the branch tip `81e6f423` (all three
commits), against `main` at `c65c2059`:
| scenario | bytes |
| --- | --- |
| five-plugin hook seam | 23,840 == 23,840 |
| a whole turn with no playbook (host turn, spawned sub-agent, tool
calls and refusals) | 12,821 == 12,821 |
| six window-shrink scenarios | 133,371 == 133,371 |
These cover the tip, not each commit separately. The seam comparison is
the one that matters most for the third commit: its first fix changed
`rolls_back_iterations` for code-flow, which decides whether replies
stream or are held, and the seam oracle records the decision at every
phase, so an unintended change there shows as a diff rather than as
silence.
A unit test proves the seat is a real decision point rather than a
pass-through: with a lenient Action role bound, a conduct's Resample is
not applied, and Planning's advice and Memory's intake are what the loop
receives.
Real model, Sonnet 4.5 through OpenRouter, at the branch tip:
- playbook on, in-process lane: two workers, each receives the charter
(3 checks), writes its file, finishes; 26 recorded model calls
- playbook on, ACP fork lane: the charter prompt crosses the process
boundary (the fork answers ZEBRA where the task text says PONG, so the
brief reached the forked model through Memory), and a charter check
blocks `write_file` to `notes/hi.txt` against a `pathPrefix: out/` rule
- Raven-Research, a fork running the full gate chain: `plain-first:
escalated_tool`, then `sufficiency-gate: released on the pages at
iteration 4 after 2 searches / 2 pages`
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
No user-visible behaviour change is intended, and the hook-seam
comparison is byte-identical on every phase it covers.
For plugin authors: the six-phase `AgentHook` is unchanged and a plugin
shipping one keeps working. `ConductHook` is an adapter that seats a
conduct in that same chain.
For anyone replacing a harness role: the role protocols gain `intake`,
`advise`, `review` and `salvage`, so a replacement written against the
old protocol needs them.
Rollback is a revert of the merge commit. Nothing persisted on disk
changes shape.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: yao pengfei <yaopengfei@shanda.com>
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
## Summary
A Windows checkout of this repo with the default `core.autocrlf=true`
rewrites every
text file to CRLF, and two byte-exact gates in `ui-web` then fail on a
tree that is
byte-identical to the one CI passes on Linux:
- the boot-order and open-conversation node tests slice their source on
`"\n}\n"`,
which never matches a CRLF file, so the sliced function comes out empty
and 9 tests
fail with `ReferenceError`;
- `gen-rpc-client --check` compares its own LF output against the file
on disk and
reports permanent drift in `src/rpc/generated.ts`.
`.gitattributes` pins the checkout filter so the working tree matches
what the
repository already stores. The repository stores LF today, so this adds
no
renormalization diff: `git add --renormalize .` over the whole tree
stages nothing
beyond the two files in this PR. Only the checkout filter changes.
`ui-web/build.py` is the other half of the same defect. It assembled the
page under
Python's default newline translation, so `dist/index.html` came out CRLF
on Windows
even from an LF source tree, and `check-page.mjs` could no longer
extract the script
payloads (its `<script>\n` anchor needs the LF to be the next byte).
That artifact
ships inside the wheel, so it must not depend on which platform
assembled it.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Run on Windows 11 with `core.autocrlf=true`, in a clean worktree cut
from `main`:
- `git add --renormalize .` after the change stages nothing (confirms no
renormalization diff);
- `file ui-web/src/rpc/generated.ts` reports CRLF on `main` and LF after
a forced
re-checkout on this branch;
- `npm run gen:check` (ui-web): `generated.ts matches the contract (178
methods)`;
- `npx vitest run` (ui-web): 108 files, 1836 tests passed;
- `npm run --prefix ui-web build && python ui-web/build.py`:
`dist/index.html` is LF;
- `node ui-web/scripts/check-page.mjs`: `OK (1,482,975 bytes, 3 scripts
parse)`;
- `node ui-web/scripts/count-shared-globals.mjs`, `check-css.mjs`,
`check-class-namespace.mjs`: all OK.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
No runtime behaviour changes for users on Linux or macOS, where the
checkout already
produced LF. On Windows the working tree stops being rewritten to CRLF,
so a
contributor with existing local checkouts may see one large
renormalization touch on
the next checkout; the committed bytes do not move. The built
`dist/index.html` is now
LF on every platform, which is what the Linux-built wheel already
shipped.
Rollback is deleting `.gitattributes` and dropping the `newline=""`
argument in
`ui-web/build.py`.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
The hand-built deck lane (Raven-Design at medium and high) and the deck
engine lane (Raven-PPT at max) as one product, measured on live runs.
- image_search for the deck lanes sits behind tools.web.search.images,
off by default and switched on by the design launcher; the readiness
probe for the deck route reads the target lane's own picture vendor; the
build-interpreter shim has a .cmd twin for native Windows.
- Deck route on Raven-Design: page furniture comes from the engine's
helper modules (ppt_layout, ppt_theme, ppt_icons, ppt_shapes,
ppt_charts) written beside the build script; diagrams, picture treatment
and cover/section compositions are drawn by hand. Five recorded runs had
each rewritten the same 48 helpers.
- Deck route keeps no anti-pattern ledger, contract or task state: nine
audited runs wrote the ledger 18 times and read it back never, and every
real fix came from reading a render. The editorial skill is read
alongside the deck skill; every page is read back from a render at 90
dpi or more before delivery.
- Defaults before questions: language of the request, general audience,
about 20 pages, light ground, memory first; ask at most once. Two of
three ask_user calls in the audit timed out unanswered.
- Formulas as pictures (matplotlib mathtext, dfrac promotion, serif
scale) and inline sub/superscript runs, shared by both lanes;
image_search for both lanes keyed by the selected search vendor; the
raven-python interpreter shim (sh wrapper, not a symlink); all three
tiers at 400 iterations.
- layouts.md gains nine compositions measured off the packaged
templates' reference pages; three rules ask for full components, a
hierarchy among them, and the whole page used.
- The max lane delivers the .pptx alone (D64); the PDF render stays the
engine's own preview.
- ppt-engine: template gates silenced on template pages, borrowed
template files kept apart from borrowed page numbers, the icon pen
follows the icon's side.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
```
uv run --frozen pytest -q -x tests/test_agents_design_launcher.py tests/test_subagent_routing_backend.py tests/test_ppt_engine_build_tool.py tests/test_ppt_engine_build_stage.py tests/test_ppt_engine_assets_formulas.py tests/test_ppt_engine_gates_registry.py
# 299 passed
```
Live runs on a test stack (medium tier, glm-5.3-flash, the
eight-character request "make a deck introducing computer vision"): with
the editorial skill read, 20 pages, 18 of them carrying a searched
picture or a paper figure, delivered in 26 minutes with no question
asked, no task-state call, no ledger, no hand-written helper, renders at
90 dpi.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
User-visible: the max lane no longer delivers a PDF beside the deck; the
design lane asks fewer questions; the host loop offers image_search only
where tools.web.search.images is on. Rollback: revert the commits
touching agents/raven-design, raven/agent and
plugins-dist/ppt-engine/raven_ppt/stages/build.py; no data migration is
involved.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
Nothing in this repo could see a signature change reach its callers.
Ruff reads one file at a time, the import contracts read edges rather
than calls, and the suite only covers lines it executes. The consequence
was concrete: a required `sandbox_home` argument added to
`BoxliteExecutor` reached `plugins-dist/design-engine`'s render path
with CI green, and a reviewer -- not a gate -- found it.
`ty` answers that question. This adds it as a pinned dev dependency, a
`make lint-types` target and a CI step, with **110 of its 133 rules
live**: nine switched off with their measured backlog recorded beside
each, fourteen shipped disabled upstream and untouched.
Getting there meant clearing 81 diagnostics. This PR folds what were
three stacked PRs (#422 and #423, now closed); each rule's story is a
commit of its own.
### 1. The gate, at 108 rules (`chore(*): gate call correctness...`)
21 diagnostics to clear, five of them real:
| Where | What |
|---|---|
| `evolver/orchestrator/production.py` | `design_of` annotated as taking
two parameters while its docstring, its only implementation and its one
call site all use three |
| `raven/cli/provider_commands.py` | `dict[str, callable]` -- the
builtin function, not a type, so the annotation asserted nothing |
| `raven/config/schema.py` | `Config` is a `BaseSettings` but declared
`env_prefix` / `env_nested_delimiter` through pydantic's `ConfigDict`,
which does not carry those keys |
| `raven/spine/delivery.py` | `StreamDelta.conversation_id` is optional
and was used as a `dict[str, str]` key; a delta without one stored a
`None` entry the close path then read as "no open stream", losing that
stream's done marker |
| `research_flow/support/harness_text.py` | a predicate table typed its
matchers as `object`, so nothing checked they are callable |
The rest were unproven invariants and annotations wider than the code:
three late-bound callables asserted where a comment used to carry the
claim, one closure binding the callable it guarded instead of re-reading
it, four `hasattr` probes that now check what the call actually needs,
and a contextmanager yielding the value it just set.
### 2. `unresolved-import` (`fix(*): resolve the imports the type gate
could not`)
21 diagnostics; three were stale module paths nothing had run into:
- `HarnessNode.current_core_version()` read `raven.__core_version__`, a
module that exists neither here nor in the wheel
`scripts/build_core_wheel.py` produces. The read sat inside `try/except
ImportError`, so the except branch was the only branch and **every node
`store.py` saved recorded `core_version="unknown"`**. It reads
`raven.__version__` now and returns `0.1.13`.
- `raven/agent/loop/wiring.py` imported `SkillForgeRouterConfig` from
`raven.config.schema`; it lives in `raven.config.raven`. Under
`TYPE_CHECKING`, so the annotation simply meant nothing.
- three scripts imported `raven.context_engine.base` and
`raven.memory_engine.base`, neither of which exists. **Two failed at
module import** -- running them was not possible.
The other eighteen were the environment: the three agent products keep
their plugin package beside them, so their roots are declared in
`[tool.ty.environment]`; `lxml` ships a compiled `etree` with no type
information, so `lxml-stubs` is a dev dependency (real types rather than
five silenced lines); `uno` and `com.sun.star.*` are suppressed per
line, since that worker runs inside LibreOffice's own interpreter.
### 3. `invalid-return-type` (`fix(*): make the declared return types
true`)
39 diagnostics, and **one stale annotation held eight of them**:
`run_turn` and the `_run_turn` behind it were declared `-> LoopOutcome`
while all three of their returns build a `TurnOutcome` -- a different
dataclass with no field in common. Nothing broke, because the spine
worker reads what it actually gets and `LoopOutcome` never leaves
`_run_agent_loop`. The annotation was the only thing wrong.
The other 31: nine annotations narrower than the code (five `return
tuple(<genexpr>)` typed as fixed-arity tuples, an inner `one()` still
declaring the two-tuple it returned before a third element was added,
`image_block`'s TypedDict), five declarations refusing a value the
function returns (four tool `execute` overrides saying `-> str` while
returning `ToolResult`), seven invariants that lived in a `# type:
ignore` comment, and ten honest widenings.
### 4. What the gates then caught in this PR's own work
- The qq factory guard passed locally only because an earlier test had
left an event loop behind. Reproduced the CI state
(`asyncio.set_event_loop(None)`), then made the test async so the loop
is its own.
- `invalid-return-type`, while still disabled, hid a regression
introduced here: the qq factory returning the class instead of an
instance. Found by diffing the rule histogram, which is why that rule is
on now.
- The diff-coverage gate named four lines in `raven/routing/cache.py` --
the asserts this work had just added, sitting inside a `try` whose
`except Exception` would have swallowed the `AssertionError` and served
the stale cache. `_do_refresh` returns its data now; the asserts, their
noqa and the swallowing all go with it.
`child_scope`, `QQChannel.start()` and `BenchmarkCache` had no tests at
all and have them now. Every one was mutation-checked.
## Type
- [ ] Fix
- [ ] Feature
- [ ] Docs
- [x] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `make lint-types` -> All checks passed; 81 diagnostics cleared across
the three rule sets
- Gate proven live three times, once per rule: a missing argument, an
import of a module that does not exist, and a function returning a str
under `-> int` each turn it red, and removing the probe turns it green
- `uv run ruff check` + `ruff format --check` over all six trees ->
clean
- `uv run lint-imports` -> 10 kept, 0 broken; `deptry raven` (all
extras) -> no issues; `uv lock --check` -> resolved
- `make check-source-language` -> exit 0; `commitlint` -> exit 0
- `make coverage` locally: **22050 passed, 45 skipped, 4 failed**; diff
coverage 92.59%
- All four failures are **pre-existing on `main`**, checked by a real
checkout in the same environment where they fail identically: two
`test_the_products_tool_face_*` launcher tests,
`test_a_ceiling_as_large_as_the_window_still_leaves_room_for_history`
(`reserved_tools = 6044 > 6_000`), and
`test_a_missing_key_is_said_once_rather_than_per_query`
(environment-dependent: it asserts `SERPER_API_KEY` is absent)
- Rule counts measured with both `--extra dev` and `--all-extras` --
identical, so this gate's verdict does not depend on which optional
packages are installed
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
Behaviour changes are confined to the fixes listed above, and each
replaces an error path with a correct one: nodes are stamped with the
real raven version instead of `"unknown"`, two scripts that could not
start now start, the stream bookkeeping no longer stores a `None` key,
and a cache refresh returns what it fetched. Everything else is a
declaration moved to match what the function already returned.
`tests/` is out of the gate's scope (113 diagnostics under the same
rules). Tests are executed, so a broken call there is already loud; this
gate is for code CI does not run. Bringing them in is sized, separate
work.
Rollback: revert the whole PR to drop the gate and its fixes together,
or delete the `[tool.ty]` block, the `lint-types` target and its CI step
to keep the fixes and drop only the gate.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
Reopens#384 on the linearized `main`, as asked in the auto-close
notice. The original branch added a two-way provider switch to a
Serper-only `web_search`; `main` has since grown a vendor table
(`SEARCH_PROVIDERS`, `tools.web.providers.<vendor>.apiKey`, the doctor
and onboard rows reading off the spec), so this is a rewrite to that
design rather than a rebase: Serply (https://serply.io) becomes the
eighth `web_search` vendor, appended after Firecrawl.
What the entry consists of:
- `raven/config/schema.py`: `serply` joins `WebSearchProvider`,
`WEB_VENDOR_ENV_VARS` (`SERPLY_API_KEY`) and `WebProvidersConfig`.
Everything that enumerates vendors off the schema (the env-file mirror,
the RPC console allow-list, the research launcher's `SEARCH_VENDORS` and
`SECRET_SLOTS`, the onboard wizard's picker) picks it up from there.
- `raven/agent/tools/web.py`: one spec row, one request branch (`GET
https://api.serply.io/v1/search?q=&num=`, key in the `X-Api-Key` header,
same 10s timeout and proxy as the others) and one normaliser branch
(Serply answers Google SERP rows under `results` with the snippet in
`description`, folded into the shared `organic` shape by `_rows`). No
answer box or knowledge graph is produced. The Serper branch is
untouched.
- the research plugin's `research_flow/tools/web.py`: the same three
additions for the research sub-agent, with `paginates=True` because
Serply takes `start` as a result offset like SerpApi (probed live:
`start=3` returns a disjoint second page). `.env.example` gains
`RESEARCH_SERPLY_API_KEY`.
- The settings page's own vendor array and label, the
`--search-provider` help text, CONTEXT.md's vendor list and a CHANGELOG
line.
- Tests: rows in the kernel request and payload tables
(`test_agent_tools_web_providers.py`, vendor floor 7 to 8), the RPC
console allow-list pin, the research payload table, and Serply added to
the paginating-vendor offset test.
Default stays `serper`; a deployment that never names `serply` sees no
change.
Disclosure: I work with Serply. Happy to trim scope (for example drop
the research plugin half) if you prefer.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
```
uv run --frozen --extra dev ruff check <7 edited .py files> -> All checks passed!
uv run --frozen --extra dev ruff format --check <7 edited .py files> -> 7 files already formatted
uv run --frozen --all-extras pytest -q tests/test_agent_tools_web_providers.py tests/test_rpc_console.py \
tests/test_agents_research_tools.py tests/test_agents_research_launcher.py tests/test_tool_capabilities.py \
tests/test_config_live.py tests/test_agent_loop_web_tools.py tests/test_cli_doctor_commands.py \
tests/test_cli_onboard_commands.py tests/test_config_raven_sections.py tests/test_config_update_tools.py \
tests/test_cli_log_file.py -> 1 failed, 890 passed
(test_cli_doctor_commands.py::test_doctor_answers_where_the_memories_are fails identically on the
untouched tree on this machine: the doctor output truncates the tmp path; unrelated)
uv run --frozen --all-extras pytest -q -> 3 failed, 22047 passed, 52 skipped (6m07s)
(the same three fail on untouched main here: the doctor memories test above plus
test_sentinel_persistence::test_cron_claim_prevents_concurrent_fire and
test_subagent_dag_runner::test_a_streaming_acp_node_is_never_announced_as_stalled, both timing-bound)
```
Live, with a real key held in the header only:
`WebSearchTool(provider="serply").execute("raven ai agent harness",
count=3)` rendered three organic rows through the shared path; `probe()`
answered `(True, '1 result(s)')`; a bogus key answered `(False, 'Serply
answered HTTP 401')` with no key text in the detail.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
- Security: the key travels in a request header to `api.serply.io` over
HTTPS, never in the URL, so the SerpApi-style URL redaction concern does
not apply. The status-error path renders vendor plus status like every
other vendor (covered by the parametrised no-echo tests).
- Backward compatibility: additive. `WebProvidersConfig` keeps
`extra="forbid"`, so the only new accepted input is the `serply` slot
and enum value.
- Rollback: revert the commit. A config that already names `serply` then
fails validation loudly, which is the intended failure mode for an
unknown vendor.
## Related Issues
#384
Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
Give each design session its own working directory under designs using a
slug and a hash of the full session key. Restore the same directory when
the session resumes, including turns that skip the user inbound hook.
Keep review ledgers and auxiliary files in the session directory and
provide workdirPerSession=false for the existing shared-directory
behavior. Preserve existing shared files and task state without guessing
ownership.
Verify concurrent sessions, resumed turns, directory name collisions,
and completion isolation with regression tests and a live ACP rendering
run.
## Summary
Design sessions using the same working directory previously shared Task
State and output files. Give each session its own directory under
`designs/`, named with a session slug and a hash of the full session
key. Reuse that directory on resume and keep review ledgers and
auxiliary files there.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
```bash
uv run --no-sync pytest -q tests/test_design_engine_*.py tests/test_agents_design_launcher.py tests/test_ppt_engine_plugin.py tests/test_agent_workdir.py -x
```
Result: 265 passed. One existing PPT test produced a non-failing timing
warning.
```bash
make check-large-files check-source-language COMMIT_RANGE=origin/main...HEAD
git diff --check
```
Result: passed. Pre-commit checks also passed for all seven changed
files.
A live ACP scenario exercised two concurrent sessions, actual model
calls, Chrome rendering, process restart, and session recovery. Both
sessions generated independent HTML, PDF, PNG, review ledgers, and Task
State. Revising session A left all nine session B artifact and state
file hashes unchanged. PDF image pixels matched the corresponding
previews.
The final verification command rechecked completed concurrent outputs
and ran the two recovery turns:
```bash
DESIGN_E2E_OUTPUT=/tmp/raven-design-live-e2e-hx9Ohs/run3 DESIGN_E2E_RESUME=1 uv run --no-sync pytest -q -s /tmp/raven-design-live-e2e-hx9Ohs/test_design_session_e2e.py
```
Result: 1 passed. This was a local live test harness outside the
repository. EverOS memory was disabled; Web UI interaction was not
covered.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
---------
Co-authored-by: Codex <noreply@openai.com>
## Summary
Merges the GitHub trunk into this fork's main, as a merge rather than a rebase:
the resolutions below live in the merge commit, and rebasing would drop them.
Eleven upstream commits since 377a1da14 (2026-08-25), fifteen files
conflicting. The conflicts worth a reviewer's attention:
- **tracing**: upstream retired the runtime attempt id. `attempt.id` is now a
reserved span attribute and `attempts.json` owns the grouping, so
`begin_attempt` / `end_attempt` / `current_attempt` and every `attempt_id`
parameter go with it. Nothing on this side called them outside tests. This
fork's `surface` field and its `use()` helper share those hunks and stay.
- **appLayout.tsx**: took upstream's copy-notice line only. Its
`FloatingOverlays` hunk would render that component twice, because this side
had already moved it into its own anchor box.
- **onboard_everos.py**: upstream only refreshed three model ids, which this
side already carries. Kept the English-only role table (AGENTS.md 1.3).
- **test_everos_server.py**: took upstream's inotify-gate tests and pointed
them at `raven_everos.server`, where this side moved the module.
- **README.zh-CN.md**: the benchmark table had to be rebuilt by hand. Its
separator row auto-merged with the prerequisites table's and silently
dropped the three data rows.
Three follow-up commits fit upstream's new tests to this fork's environment.
Each is a fork/upstream difference, not a defect upstream:
- The listing tests widen the console with `env={"COLUMNS": "200"}`. That
cannot work here: this suite runs under xdist (`addopts` carries `-n 4`) and
its workers export `COLUMNS=80`, which rich freezes into `Console._width` at
import time, before any invoke sets the variable. An autouse fixture gives
the module console a real width, the way upstream's own browse test does.
- One test patched `raven.config.loader._current_config_path`; this fork keeps
that name in `raven.home`.
- Three CJK fixtures are written as `\uXXXX` escapes so the language gate
passes. `test_table_cjk_cells_stay_within_budget` measures what an
east-asian glyph costs in a table cell, so an ASCII replacement would void
the test; the escape keeps the runtime value upstream's.
**Reviewer attention, one deliberate rule break**: `MODULES_IN_CYCLES_CEILING`
in `tests/test_import_cycle_budget.py` goes 42 -> 46, and that file's comment
says the ceilings may only go down. Upstream's four new modules import each
other in pairs (`cli.trajectory_browse` with `cli.trajectory_commands`,
`trajectory.bugreport` with `trajectory.review`). Neither pair can be unpicked
by deferring an import, because that graph counts a function-local import like
a top-level one, so unpicking either means moving code that has just arrived
from upstream. The package and pair ceilings did not move. Raising the number
here is the call a reviewer may want to reverse; doing so means a refactor of
upstream's new modules, roughly 110 lines moved.
Project settings changed alongside this: `squash_option` `always` ->
`default_off`. A squash would flatten the merge commit and lose the manual
resolutions above, after which the next sync would have to redo all of them.
`merge_method` was already `merge` and is untouched.
A manual smoke run on the real hosts found one bug the suites did not, now
fixed on this branch: the sync took upstream's copy-on-select wiring into
`useMainApp` but not the two import lines it needs. Both sides had edited that
import block, so git resolved it to this fork's version and the added lines
went with it -- a semantic conflict, no marker. `raven tui --dev` died on entry
with `createCopyOnSelectReporter is not defined`. The 2072 vitest tests did not
catch it (none imports and renders the whole hook) and neither did eslint
(undefined names are left to the type checker here); `npm run type-check` does,
and is clean after the fix.
**Known red gate, recorded rather than bypassed.** Five of the eleven imported
commits fail `scripts/check_commit_messages.py` over this MR's range
(`1aef9f50`, `a83a3565`, `5ab90aa5`, `9c55d545`, `dcedd1c4`). The only
non-ASCII in them is three characters: the display name in a colleague's
`Co-authored-by` trailer (U+6C5F U+56FD U+5E86, address `guoqingjiang@`
unchanged and ASCII). Subjects and bodies are English. The job that runs this
checker fires on GitHub `pull_request` events, so a merge performed on GitLab
never runs it -- which is why this pipeline is green while the gate is red over
the same range.
The disposition, settled between the maintainer and the reviewer: a single
deliberate pass over the imported history will rewrite committer and author
information wholesale, and these five trailers belong to that pass. Rewriting
them here would be redone by it. So this is assigned to the change that can do
it once across all imported history, rather than five commits at a time inside
a sync -- not waved through as unimportant. This paragraph exists so the next
reader sees the gate was weighed, not missed.
One cleaner route remains open and is deliberately not taken here: teaching
`commit_lint.py` that a trailer's display name may be non-ASCII while its
address stays ASCII, which is arguably what AGENTS.md 3.1.1 already means when
its table calls the trailer "ASCII by format".
## Type
- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [x] Other (upstream sync)
## Verification
- `uv run --all-extras pytest -q` -> 21814 passed, 4 failed, 45 skipped.
The four are pre-existing on main, verified by running them on a clean
`origin/main` worktree in the same environment:
`test_agents_oncall_launcher.py::test_the_products_tool_face_equals_the_forks_config_intent`,
`test_agents_code_launcher.py::test_the_products_tool_face_is_the_forks_config_intent_minus_the_ledger`,
`test_agent_loop_token_budget.py::test_a_ceiling_as_large_as_the_window_still_leaves_room_for_history`,
`test_ppt_engine_image_search.py::test_a_missing_key_is_said_once_rather_than_per_query`.
- `npm test` in `ui-tui/` -> 143 files, 2072 tests, all passing.
- `make lint-python` -> 1930 files already formatted.
- `make lint-imports` -> 10 contracts kept, 0 broken.
- `make lint-deps` -> no dependency issues.
- `make check-source-language` -> clean.
- `make check-large-files` -> clean.
Manual smoke on the real hosts (isolated `RAVEN_HOME`, own tmux session, the
running instance on this machine left untouched):
- `raven trajectory list` -> three attempts, matching the span log on disk.
- Interactive browser (bare `raven trajectory`, driven under tmux): session
list, attempt list, and the `turn.input_preview` values all render from the
real log. `[M]` merged two attempts; `attempts.json` gained the definition
with exactly those two member trace ids, and the span log stayed append-only.
- `raven trajectory split` put it back: `attempts.json` empty, listing back to
three rows.
- `raven trajectory report-bug` produced `br-20260911-b19368.tar.gz` with the
envelope and the nested trajectory inside; it correctly reported the fixture
as unreplayable and pinned the attempt.
- `raven tui --dev` reaches the main layout, and the completion overlay anchors
correctly (the `FloatingOverlays` hunk this merge resolved by hand).
- Copy-on-select driven end to end by sending SGR mouse press/drag/release
through tmux, against a sentinel value placed on the clipboard first. The
first drag put the selected span on the clipboard (`pbpaste` returned
exactly the 76 characters under the drag) and reported `copied 76
characters` into the transcript; a second drag reported `copied 10
characters` as the transient notice above the composer, which is the line
this merge resolved by hand. One drag, one clipboard write, one notice:
the duplicate subscription is gone from the observable behaviour too, not
only from the source. The host clipboard was restored byte-for-byte after.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
## Risk
User-visible changes all come from upstream: the interactive trajectory
browser, the tester-facing bug report flow, the feishu websocket backoff, the
EverOS inotify spawn gate, and the TUI copy-on-select notice. The fork's own
behaviour is unchanged; the only fork-side edits are in tests.
The one runtime removal is the tracing attempt API. No caller outside tests
used it on this side, and upstream replaced what it did with `attempts.json`.
Rollback: revert the merge commit. Because this lands as a merge rather than a
squash, the branch history stays intact and a revert leaves main exactly where
it was.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
Eleven commits from the GitHub trunk since 377a1da14, fifteen files
conflicting. How each was resolved:
- raven/tracing/context.py, trace.py, spans.py and tests/test_tracing_api.py:
upstream retired the runtime attempt id. attempt.id is now a reserved span
attribute and attempts.json owns the grouping, so begin_attempt,
end_attempt, current_attempt and every attempt_id parameter go with it.
Nothing on this side called them outside tests. The fork's surface field
and its use() helper share those hunks and stay.
- raven/trajectory/store.py: upstream's module docstring documents
attempts.json and is a superset of ours.
- raven/cli/onboard_everos.py and tests/test_cli_onboard_commands.py:
upstream only refreshed three model ids, which this side already carries.
Kept our English-only role table (AGENTS.md 1.3).
- tests/test_everos_server.py: took upstream's inotify-gate tests and pointed
them at raven_everos.server, where this side moved the module.
- ui-tui/src/app/useMainApp.ts: copy-on-select was never wired up here;
upstream wires it.
- ui-tui/src/components/appLayout.tsx: took upstream's copy notice line only.
Its FloatingOverlays hunk would render that component twice, because this
side had already moved it into its own anchor box.
- README.md and README.zh-CN.md: upstream's wording under this side's emoji
headings. The zh benchmark table had to be rebuilt: its separator row
auto-merged with the prerequisites table's and dropped the data rows.
- tests/test_provider_rates.py and tests/test_trajectory_bundle.py: both
sides appended independent tests at the end of the file; kept both.
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
Two lanes can produce a deck: the design lane draws its own pages, and the
template lane fills a prepared template. This combines two branches that
together decide which lane runs and equip the one that keeps the work.
Routing. A route entry is no longer only a target name. It declares what the
work owes and what to tell the row's own implementation when the route is closed
to a dispatch, either inline or in a file beside the manifest - prose inside a
JSON string is one line, unreviewable as a diff and unformattable. Both are the
row's words, not the gate's: the gate that closes a route is one piece of code
serving every row that declares one. The route to the template lane is closed
when the deployment cannot spend what that lane is built to spend. It gathers
pictures two ways, by generating them and by searching for them, and holds
neither without a key. The keys are read through the same live readers the tools
are registered from, and re-read per dispatch, so a key pasted into settings
opens the route without a restart and the answer cannot disagree with whether
the model is actually offered those tools.
Skills. The design lane gets a Skill corpus of its own, mounted alongside the
engine wheel's. The engine's corpus is the shared visual domain; this one
carries what is true of the deployment the product runs on - which tools answer
here, what the gates refuse, the page shapes and the numbers, and how to key a
cut-out out of a green screen. It sits beside the manifest that declares it, so
a checkout that has the manifest has it too.
Tiers. Medium is the one mode that names a reasoning effort of its own. Below
the top tier this agent designs the deck itself rather than handing it to the
template lane, and the cheapest tier also asking for the host's full thinking
budget is the combination nobody chose. The other modes say nothing, which is
the same as inheriting the host's.
## Type
- [ ] Fix
- [x] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Run in a clean worktree cut from the current main tip, after
`uv sync --frozen --all-extras`.
- `uv run pytest` over the affected files: 1312 passed, exit 0. Files:
test_subagent_routing_backend, test_subagent_vendored_agents,
test_agents_design_launcher, test_agents_ppt_launcher,
test_subagent_registry, test_subagent_builtin_agents, test_config_schema,
test_agent_schemas, test_acp_schema, test_subagent_manager,
test_subagent_direct_chat, test_subagent_mode_resolution,
test_subagent_mode_wiring, test_subagent_third_party,
test_cli_agent_loop_wiring, test_cli_subagent_setup, test_rpc_subagents,
test_rpc_schema_match, test_update_subagents, test_agent_loop_web_tools.
- `make lint-python`: exit 0. ruff check reported "All checks passed" and ruff
format reported "1921 files already formatted".
- Import check over every module this touches, exit 0: the routing backend,
the subagent registry, manager and vendored agents, the loop entry and its
wiring, and the config schema.
The second mounted corpus changes the render's mount list, which three launcher
tests pinned as exactly one row. They now pin the pair in append order.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
Behaviour a deployment can see change:
- A deck request can stay on the design lane where it previously went to the
template lane. That happens only where the web-search key or the image key is
missing, and where it happens the template lane could not have gathered its
pictures anyway.
- The render mounts a second always-on Skill directory, and mode entries gained
a row. An entry that already names a reasoning effort now keeps it, so an
operator's pinned effort is no longer overwritten by the host's.
- A route declaring both an inline note and a note file is refused at config
load. No route in the tree declares either today, so no current config is
affected.
Rollback: revert this merge. The new route fields default to empty and the
closed-route gate is inert wherever both keys are present, so reverting the
routing change alone is also safe.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
Some sessions could not be deleted from the rail at all. Clicking Delete drew
"deletion failed: session ... no longer exists" and left the row where it was, and
every further click did the same.
`session.delete` answers a null `deleted` for two opposite situations, and the rail
had no way to tell them apart:
| the engine found | what the caller should do |
|---|---|
| a file, and removed it | drop the row |
| no file at all -- an unknown key, or a conversation whose opening turn never saved one | drop the row: that is already the goal |
| a file the filesystem refused to remove | keep the row, and say so |
The rail treated the middle row as the bottom one. It threw on any null, so
`leaveDeletedSession` never ran and the row survived -- while the message told the
reader the session did not exist, which is the opposite of a failure to remove it.
A conversation whose first turn never reached a save is exactly the middle row, and
this is why such a row could never be cleared.
`still_on_disk` splits the null. It is answered by asking the store again after the
delete, so the manager keeps its signature and `deleted` keeps the meaning its other
two readers already rely on: the TUI's `/session delete` still says "no such session"
for an unknown key, and the bulk delete still counts what is left.
The rail reads it as `!== false`, not as falsy, matching the idiom this layer already
uses for a field an older engine may not carry. A page can be rebuilt while the engine
keeps running, so a new page against an older one gets no field at all -- and saying
nothing is not saying "nothing was there". That case keeps the pre-field behaviour,
which is the conservative half: a rail must never claim something is gone while its
file is still on disk.
The failure toast also stopped being hardcoded Chinese, which rendered that way in an
English session.
**Checked and deliberately not changed:**
- `still_on_disk` is about the file, deliberately. The ACP surface answers the same
question from its own in-process registry (`session/delete` judges existence before
the delete, because a session minted and never prompted lives in the cache alone).
That mechanism is not reachable from this path and answers a different question --
whether the id is known, not whether bytes remain -- and the file is what the rail's
invariant is about. The spec page describing it needs no edit; it documents the ACP
surface, not this method.
- Three sibling toasts in the same file are still hardcoded Chinese
(`subscription failed`, `switch failed`, `opening a session failed`). They are the
same defect with a different owner; a change that fixes the delete path should not
quietly rewrite three unrelated error paths.
- The busy refusal is untouched. Deleting a session with a turn in flight still raises
`turn_in_progress`, and the sentence the server builds for it still does not reach
the client, which sees the code name alone. That is a separate finding with a
separate fix, and folding it in here would mix two focuses.
- `SessionManager.delete` keeps returning one boolean. Its other callers ask "was a
file removed", which is what it answers; widening it would change a seam three
faces share to serve one of them.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Reproduced first, on a real engine over the live socket, before any edit: a session
created and never saved answered `{"deleted": null}`, and the page's own handler threw
on it and kept the row.
After the change, the three answers on a running engine built from this branch:
```
a session that never saved a file -> {"deleted": null, "still_on_disk": false}
an unknown id -> {"deleted": null, "still_on_disk": false}
a saved session, removed -> {"deleted": "tui:...", "still_on_disk": false}
```
The refused-removal answer could not be produced on this machine: the probe runs as
root, and root's unlink is not stopped by a directory's write bit -- a session in a
`chmod 500` directory still deleted. That branch is driven by a unit test that raises
the same `OSError` from `Path.unlink` instead, and the mutation run below is what shows
the test is what catches the flag being wrong rather than the assertion passing by
accident.
```
uv run pytest tests/test_rpc_session.py -k delete tests/test_rpc_schema_match.py
19 passed
make test-python
21300 passed, 61 skipped, 6 failed
The 6 are all in tests/test_agents_code_flow_manifest.py and fail identically on
plain origin/main in a clean worktree: 12 ids running that file alone on the base,
the same 12 ids running it alone on this branch, diffed character for character,
0 introduced. They shell out to git and this host's git refuses a switch they pass
("error: unknown switch `b'"); nothing on this branch touches that area.
make test-ui 103 files, 1667 passed
make lint-ui exit 0 (gen:check 168 methods matches the contract; tsc clean)
make build-ui exit 0
make lint-tui exit 0
make lint-python exit 0
make lint-imports exit 0
make check-commits, check-source-language, check-large-files exit 0
```
7 mutations applied one at a time, every one red, none survived:
```
the engine never reports a surviving file 1 failed
an absent session is reported as still on disk 2 failed
the field is dropped from the answer 6 failed
the rail's old throw-on-any-null comes back 1 failed
falsy instead of `!== false` (an older engine drops rows) 1 failed
the rail's guard is removed entirely 2 failed
an absent session is reported to the reader as deleted 1 failed
```
The first three ran against the python delete tests, the last four against the new
rail test. The rail branch had no test at all before this: the live layer is plain
script, so the test reads the one assignment out of the source and drives it with
stubs, the way the parked-turn and capabilities tests already reach that layer. Its
first version was checked with a type-check rather than a behavioural test, and the
client mutation survived that -- which is how the gap was found.
Existing assertions whose meaning changed: four `session.delete` tests asserted the
whole result dict and now carry the new key. They are the same claims, not weakened
ones, and two new cases pin the two halves of the null.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed (no user-facing doc
describes what Delete answers; the RPC contract and the method docstring are
updated in place)
## Risk
User-visible: a row for a session with nothing on disk now leaves the list on Delete
instead of staying with an error, and the toast names which of the two happened. A
session whose file survives a refused removal behaves as before -- the row stays and
the toast reports it. No other delete face changes: the TUI's wording for an unknown
id and the bulk delete's partial count both read the unchanged `deleted`.
Wire change: `SessionDeleteResult` gains one optional boolean. Both generated clients
are regenerated from the contract. An older client ignores it; an older engine omits
it, which the rail reads as "cannot tell" and handles as it did before the field
existed.
Rollback is reverting the squash commit; the rail returns to throwing on any null.
- [x] Security impact considered (no new surface: one boolean derived from a path
existence check the method already had access to)
- [x] Backward compatibility considered (optional field both directions, and the
rail's `!== false` is what makes the missing-field direction safe)
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
Some sessions could not be deleted from the rail at all. Clicking Delete drew
"deletion failed: session ... no longer exists" and left the row where it was, and
every further click did the same.
`session.delete` answers a null `deleted` for two opposite situations, and the rail
had no way to tell them apart:
| the engine found | what the caller should do |
|---|---|
| a file, and removed it | drop the row |
| no file at all -- an unknown key, or a conversation whose opening turn never saved one | drop the row: that is already the goal |
| a file the filesystem refused to remove | keep the row, and say so |
The rail treated the middle row as the bottom one. It threw on any null, so
`leaveDeletedSession` never ran and the row survived -- while the message told the
reader the session did not exist, which is the opposite of a failure to remove it.
A conversation whose first turn never reached a save is exactly the middle row, and
this is why such a row could never be cleared.
`still_on_disk` splits the null. It is answered by asking the store again after the
delete, so the manager keeps its signature and `deleted` keeps the meaning its other
two readers already rely on: the TUI's `/session delete` still says "no such session"
for an unknown key, and the bulk delete still counts what is left.
The rail reads it as `!== false`, not as falsy, matching the idiom this layer already
uses for a field an older engine may not carry. A page can be rebuilt while the engine
keeps running, so a new page against an older one gets no field at all -- and saying
nothing is not saying "nothing was there". That case keeps the pre-field behaviour,
which is the conservative half: a rail must never claim something is gone while its
file is still on disk.
The failure toast also stopped being hardcoded Chinese, which rendered that way in an
English session.
**Checked and deliberately not changed:**
- `still_on_disk` is about the file, deliberately. The ACP surface answers the same
question from its own in-process registry (`session/delete` judges existence before
the delete, because a session minted and never prompted lives in the cache alone).
That mechanism is not reachable from this path and answers a different question --
whether the id is known, not whether bytes remain -- and the file is what the rail's
invariant is about. The spec page describing it needs no edit; it documents the ACP
surface, not this method.
- Three sibling toasts in the same file are still hardcoded Chinese
(`subscription failed`, `switch failed`, `opening a session failed`). They are the
same defect with a different owner; a change that fixes the delete path should not
quietly rewrite three unrelated error paths.
- The busy refusal is untouched. Deleting a session with a turn in flight still raises
`turn_in_progress`, and the sentence the server builds for it still does not reach
the client, which sees the code name alone. That is a separate finding with a
separate fix, and folding it in here would mix two focuses.
- `SessionManager.delete` keeps returning one boolean. Its other callers ask "was a
file removed", which is what it answers; widening it would change a seam three
faces share to serve one of them.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Reproduced first, on a real engine over the live socket, before any edit: a session
created and never saved answered `{"deleted": null}`, and the page's own handler threw
on it and kept the row.
After the change, the three answers on a running engine built from this branch:
```
a session that never saved a file -> {"deleted": null, "still_on_disk": false}
an unknown id -> {"deleted": null, "still_on_disk": false}
a saved session, removed -> {"deleted": "tui:...", "still_on_disk": false}
```
The refused-removal answer could not be produced on this machine: the probe runs as
root, and root's unlink is not stopped by a directory's write bit -- a session in a
`chmod 500` directory still deleted. That branch is driven by a unit test that raises
the same `OSError` from `Path.unlink` instead, and the mutation run below is what shows
the test is what catches the flag being wrong rather than the assertion passing by
accident.
```
uv run pytest tests/test_rpc_session.py -k delete tests/test_rpc_schema_match.py
19 passed
make test-python
21300 passed, 61 skipped, 6 failed
The 6 are all in tests/test_agents_code_flow_manifest.py and fail identically on
plain origin/main in a clean worktree: 12 ids running that file alone on the base,
the same 12 ids running it alone on this branch, diffed character for character,
0 introduced. They shell out to git and this host's git refuses a switch they pass
("error: unknown switch `b'"); nothing on this branch touches that area.
make test-ui 103 files, 1667 passed
make lint-ui exit 0 (gen:check 168 methods matches the contract; tsc clean)
make build-ui exit 0
make lint-tui exit 0
make lint-python exit 0
make lint-imports exit 0
make check-commits, check-source-language, check-large-files exit 0
```
7 mutations applied one at a time, every one red, none survived:
```
the engine never reports a surviving file 1 failed
an absent session is reported as still on disk 2 failed
the field is dropped from the answer 6 failed
the rail's old throw-on-any-null comes back 1 failed
falsy instead of `!== false` (an older engine drops rows) 1 failed
the rail's guard is removed entirely 2 failed
an absent session is reported to the reader as deleted 1 failed
```
The first three ran against the python delete tests, the last four against the new
rail test. The rail branch had no test at all before this: the live layer is plain
script, so the test reads the one assignment out of the source and drives it with
stubs, the way the parked-turn and capabilities tests already reach that layer. Its
first version was checked with a type-check rather than a behavioural test, and the
client mutation survived that -- which is how the gap was found.
Existing assertions whose meaning changed: four `session.delete` tests asserted the
whole result dict and now carry the new key. They are the same claims, not weakened
ones, and two new cases pin the two halves of the null.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed (no user-facing doc
describes what Delete answers; the RPC contract and the method docstring are
updated in place)
## Risk
User-visible: a row for a session with nothing on disk now leaves the list on Delete
instead of staying with an error, and the toast names which of the two happened. A
session whose file survives a refused removal behaves as before -- the row stays and
the toast reports it. No other delete face changes: the TUI's wording for an unknown
id and the bulk delete's partial count both read the unchanged `deleted`.
Wire change: `SessionDeleteResult` gains one optional boolean. Both generated clients
are regenerated from the contract. An older client ignores it; an older engine omits
it, which the rail reads as "cannot tell" and handles as it did before the field
existed.
Rollback is reverting the squash commit; the rail returns to throwing on any null.
- [x] Security impact considered (no new surface: one boolean derived from a path
existence check the method already had access to)
- [x] Backward compatibility considered (optional field both directions, and the
rail's `!== false` is what makes the missing-field direction safe)
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
The Raven-PPT roster row is `hidden` and reached only through Raven-Design's
`routes`, so the single reader of its `description` is the host's route
classifier in `SubagentManager._classify`. Every other surface filters the row
out through `AgentRegistry.enabled()`; the route menu is built from the raw row
dict and bypasses that filter. Editing this one field is therefore editing the
router, and everything in it is sent on every classification call.
The text that field carried had defects in both directions. It opened by
inviting source paths ("name existing absolute paths in the task text when you
have source documents"), which the classifier reads as a deck request whenever a
task merely cites a .pptx, and it named no deck-adjacent vocabulary, so template
decks were pushed to the design agent instead.
The replacement states the deliverable, denies the source-material case
explicitly, and enumerates the wording that counts (presentation, slides,
keynote, deck template).
It also retires the briefing sentence this row carried. That sentence told the
delegating agent to hand over the user's own words; it entered while this row
was still on the roster that agent reads, and making the row hidden, later, put
it out of reach. It has been inert since: the classifier is asked for an agent
name and can act on nothing else. Raven-Design's row is what the delegating
agent does read, and it carries the same instruction, so the behaviour is
delivered there rather than lost here.
`tests/test_agents_ppt_launcher.py` carries the ledger of deltas against the
vendored twin. It records the routing half as a new delta and the briefing
sentence as retired, each with its reason, and pins every direction the fix
turns on: the fork's source-path invitation must be absent from this row, the
source-material denial must be present, every shape a deck request takes must be
named, and this row must carry no briefing sentence.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Routing accuracy, measured by building the classifier's own messages and
swapping only the description: 40 bilingual tasks (20 zh, 20 en; 20 expecting
the deck agent, 20 expecting the design agent) at 5 repeats, on two models --
`z-ai/glm-5.3-flash`, which is this host's default, and
`deepseek-v4-flash-vision-exp`.
| description | glm-5.3-flash | deepseek-v4-flash | total |
|---|---|---|---|
| before | 189/200 | 193/200 | 382/400 |
| after | 200/200 | 200/200 | 400/400 |
The old text's errors were not scatter. "design a brand style guide from
/data/keynote.pptx" went to the deck agent 10 times out of 10 across both
models; "a deck template in our brand colors" and its zh twin went to the design
agent 6 times out of 20. The new text returned zero misses, in a second
independent batch as well as the one above.
Keeping the retired briefing sentence was measured rather than assumed: the same
set, the same 5 repeats, the same two models, scored 400/400 with it and 400/400
without. Dropping it costs no routing accuracy and takes 267 characters off
every classification call.
Test commands and results:
- `pytest` over every test file that reads an `agents/` manifest (30 files,
found by grep rather than by hand): 1187 passed, 2 skipped, 3 deselected. Both
skips are pre-existing and root-only (chmod has no effect as root).
- `ruff check` and `ruff format --check` on the changed test file: passed.
- `scripts/check_commit_messages.py origin/main..HEAD`: passed.
- `scripts/check_source_language.py origin/main...HEAD`: passed.
- `scripts/check_large_files.py origin/main..HEAD`: passed.
The ledger assertions were shown to be load-bearing rather than decorative, by
mutation rather than by reading. Restoring only the fork's routing half fails on
`"name existing absolute paths" not in told`; re-adding a briefing sentence
fails on `"IMPORTANT:" not in told`; deleting the vocabulary clause, or any one
of the four shapes in it, fails on that shape's own assertion. Seven mutants,
seven distinct failures.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No user-facing doc states this row's text; the row is off the roster the model
reads, so there is no rendered surface to update.
## Risk
Behaviour change: a task dispatched to Raven-Design is classified with different
evidence, so some tasks that used to reach the deck agent will now stay with the
design agent and the reverse. The measurement above is the argument that the new
assignment is the correct one, but it is a sample, not a proof.
Two limits worth stating. `temperature=0` is not deterministic on either
provider here: the same variant and model produced 195/200 and 199/200 on
consecutive runs, which is why every figure above is 5 repeats on two models
rather than a single pass. And the harness that produced these numbers is not in
the repo, so the table cannot be re-derived from this branch; it builds the
messages `_classify` builds and substitutes only the description.
The briefing sentence is removed from this row only. If the row is ever
unhidden, it becomes a roster line again and the question of what it should tell
the delegating agent reopens; the ledger entry says so.
Rollback is a one-field revert of `agents/raven-ppt/subagent.json` plus the
ledger assertions that pin it. No schema, no config, no credential surface is
touched.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
The Raven-PPT roster row is `hidden` and reached only through Raven-Design's
`routes`, so the single reader of its `description` is the host's route
classifier in `SubagentManager._classify`. Every other surface filters the row
out through `AgentRegistry.enabled()`; the route menu is built from the raw row
dict and bypasses that filter. Editing this one field is therefore editing the
router, and everything in it is sent on every classification call.
The text that field carried had defects in both directions. It opened by
inviting source paths ("name existing absolute paths in the task text when you
have source documents"), which the classifier reads as a deck request whenever a
task merely cites a .pptx, and it named no deck-adjacent vocabulary, so template
decks were pushed to the design agent instead.
The replacement states the deliverable, denies the source-material case
explicitly, and enumerates the wording that counts (presentation, slides,
keynote, deck template).
It also retires the briefing sentence this row carried. That sentence told the
delegating agent to hand over the user's own words; it entered while this row
was still on the roster that agent reads, and making the row hidden, later, put
it out of reach. It has been inert since: the classifier is asked for an agent
name and can act on nothing else. Raven-Design's row is what the delegating
agent does read, and it carries the same instruction, so the behaviour is
delivered there rather than lost here.
`tests/test_agents_ppt_launcher.py` carries the ledger of deltas against the
vendored twin. It records the routing half as a new delta and the briefing
sentence as retired, each with its reason, and pins every direction the fix
turns on: the fork's source-path invitation must be absent from this row, the
source-material denial must be present, every shape a deck request takes must be
named, and this row must carry no briefing sentence.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Routing accuracy, measured by building the classifier's own messages and
swapping only the description: 40 bilingual tasks (20 zh, 20 en; 20 expecting
the deck agent, 20 expecting the design agent) at 5 repeats, on two models --
`z-ai/glm-5.3-flash`, which is this host's default, and
`deepseek-v4-flash-vision-exp`.
| description | glm-5.3-flash | deepseek-v4-flash | total |
|---|---|---|---|
| before | 189/200 | 193/200 | 382/400 |
| after | 200/200 | 200/200 | 400/400 |
The old text's errors were not scatter. "design a brand style guide from
/data/keynote.pptx" went to the deck agent 10 times out of 10 across both
models; "a deck template in our brand colors" and its zh twin went to the design
agent 6 times out of 20. The new text returned zero misses, in a second
independent batch as well as the one above.
Keeping the retired briefing sentence was measured rather than assumed: the same
set, the same 5 repeats, the same two models, scored 400/400 with it and 400/400
without. Dropping it costs no routing accuracy and takes 267 characters off
every classification call.
Test commands and results:
- `pytest` over every test file that reads an `agents/` manifest (30 files,
found by grep rather than by hand): 1187 passed, 2 skipped, 3 deselected. Both
skips are pre-existing and root-only (chmod has no effect as root).
- `ruff check` and `ruff format --check` on the changed test file: passed.
- `scripts/check_commit_messages.py origin/main..HEAD`: passed.
- `scripts/check_source_language.py origin/main...HEAD`: passed.
- `scripts/check_large_files.py origin/main..HEAD`: passed.
The ledger assertions were shown to be load-bearing rather than decorative, by
mutation rather than by reading. Restoring only the fork's routing half fails on
`"name existing absolute paths" not in told`; re-adding a briefing sentence
fails on `"IMPORTANT:" not in told`; deleting the vocabulary clause, or any one
of the four shapes in it, fails on that shape's own assertion. Seven mutants,
seven distinct failures.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No user-facing doc states this row's text; the row is off the roster the model
reads, so there is no rendered surface to update.
## Risk
Behaviour change: a task dispatched to Raven-Design is classified with different
evidence, so some tasks that used to reach the deck agent will now stay with the
design agent and the reverse. The measurement above is the argument that the new
assignment is the correct one, but it is a sample, not a proof.
Two limits worth stating. `temperature=0` is not deterministic on either
provider here: the same variant and model produced 195/200 and 199/200 on
consecutive runs, which is why every figure above is 5 repeats on two models
rather than a single pass. And the harness that produced these numbers is not in
the repo, so the table cannot be re-derived from this branch; it builds the
messages `_classify` builds and substitutes only the description.
The briefing sentence is removed from this row only. If the row is ever
unhidden, it becomes a roster line again and the question of what it should tell
the delegating agent reopens; the ledger entry says so.
Rollback is a one-field revert of `agents/raven-ppt/subagent.json` plus the
ledger assertions that pin it. No schema, no config, no credential surface is
touched.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
N/A
## Summary
A session on DeepSeek's own API (`deepseek/deepseek-flash`) became unrecoverable on 2026-09-11: every request was refused with HTTP 400 `No tool call found for tool output` (or the reverse, `No tool output found for tool call`), whatever the user typed. Three defects lined up:
1. **The Curator's budget trimming broke tool pairing.** `HistoryTrimmer.trim` closed the plan's selection over tool-call adjacency, then dropped one id at a time without re-closing. Dropping the assistant that declared three parallel calls left its three results; dropping one result left its call unanswered. The fallback path never ran `structural_errors`, so the trace recorded `ok: True` for a request a strict backend refused. `trim` now drops a call and its results as one group (`tool_group`), re-closes and re-anchors after every drop, and sweeps a selection whose parent the session no longer holds; `CuratorAssembler.build` runs the structural check on every path and carries the verdict in `validation`.
2. **The context window fell back to 65,536 silently.** `deepseek/deepseek-flash` is in no catalogue, so `effective_context_window` returned the default -- one sixteenth of the model's 1,048,576 -- and only LiteLLM's DEBUG noise said so. With 49,152 reserved for output, 4,151 tokens were left for history, which is what drove the trimming above. The fallback now warns once per model (only when the catalogues were actually asked), `raven doctor`'s `Context win` line says whether the number is pinned, from a catalogue, or the default, and the config health check reports the unpinned-and-unknown case.
3. **The id was not in LiteLLM's table.** `import_litellm` now registers `deepseek/deepseek-flash` (and the bare `deepseek-flash`) into the live table: window 1,048,576, output ceiling 384,000, DeepSeek's peak-hour prices. This is the dict the window resolver, the output-ceiling resolver and the cost recorder all read, so it also stops `cost_usd` being recorded as 0. A row a newer LiteLLM already carries is left alone; OpenRouter-routed ids are deliberately not registered.
Evidence is in the Curator's per-turn traces: `window=65536 out=49152 tools=10594 sys=1639 avail_hist=4151`, fallback path, `dropped message 32` (the assistant) with `included_message_ids: [35]` (one of its results). The session file itself was intact (34 calls, 34 results); after pinning the window the same session resumed on the fast path.
Not in this MR: the Curator's own calls are capped at `max_tokens=2048`, and on a model that reasons before answering two of six curator calls in one turn were cut with the last tool call unparsed, sending four turns in a row to the deterministic fallback. Left as it is -- it affects every product's every turn (up to 12 calls) and there is no comparison data; if it is raised it should be a config knob in its own MR.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `pytest tests/test_history_trimmer.py tests/test_curator_context_engine.py tests/test_provider_rates.py tests/test_litellm_setup.py tests/test_cli_doctor_window_line.py`: new cases -- a group drop removes the parent with all its results and a result with its parent and siblings; the history re-anchors on a user message after a drop; a result whose parent the session lost is not shipped; the fallback path records `errors` and ships no orphan; the default-window fallback warns once, not for a pin, not on the cheap tier; the registered row is present, reaches both resolvers, and does not override an existing row; the doctor line's three branches.
- Reverse check: with the three source files restored to `origin/main`, the new tests fail (trimmer 4, curator 1, rates 3, litellm_setup 3, doctor 1 import error); with the fix they pass.
- Wider run: `tests/test_agent_loop*.py tests/test_context*.py tests/test_curator*.py tests/test_memory*.py tests/test_litellm*.py tests/test_provider*.py tests/test_acp_*.py` + the above: 2799 passed, 38 skipped, 0 failed.
- `ruff check` / `ruff format --check` clean on every changed file.
- `tests/test_cli_doctor_commands.py` could not run in this environment (its autouse fixture needs `raven_everos`, 74 pre-existing errors on `main` too); the doctor line is covered by a separate file that needs only the resolver.
- End to end: the failing session (`~/.raven-ar6-ds`, 54 messages, one assistant with three parallel calls) resumed after the window was pinned; every request since carried the full history on the fast path.
## Risk
- Trimming semantics: a drop now removes a whole tool group where it removed one message; a budget that previously kept a partial group now keeps either all of it or none. The set of ids that survive can differ from before, but never in a way a provider rejects. Every existing test in the touched suites passes unchanged.
- `validation` gains an `errors` key on every path (previously only in `validate_candidate`); `ok` is now false when pairing is broken. Nothing in the tree read `ok` as budget-only.
- Registered prices are peak-hour; off-peak is half, and a flat table cannot say so, so recorded cost is an upper bound. Users on OpenRouter are unaffected (their ids are not registered).
- The new warning fires once per model per process; `allow_fetch=False` callers do not trigger it.
- Rollback: revert the three commits; no data or config involved.
## Related Issues
N/A
## Summary
A session on DeepSeek's own API (`deepseek/deepseek-flash`) became unrecoverable on 2026-09-11: every request was refused with HTTP 400 `No tool call found for tool output` (or the reverse, `No tool output found for tool call`), whatever the user typed. Three defects lined up:
1. **The Curator's budget trimming broke tool pairing.** `HistoryTrimmer.trim` closed the plan's selection over tool-call adjacency, then dropped one id at a time without re-closing. Dropping the assistant that declared three parallel calls left its three results; dropping one result left its call unanswered. The fallback path never ran `structural_errors`, so the trace recorded `ok: True` for a request a strict backend refused. `trim` now drops a call and its results as one group (`tool_group`), re-closes and re-anchors after every drop, and sweeps a selection whose parent the session no longer holds; `CuratorAssembler.build` runs the structural check on every path and carries the verdict in `validation`.
2. **The context window fell back to 65,536 silently.** `deepseek/deepseek-flash` is in no catalogue, so `effective_context_window` returned the default -- one sixteenth of the model's 1,048,576 -- and only LiteLLM's DEBUG noise said so. With 49,152 reserved for output, 4,151 tokens were left for history, which is what drove the trimming above. The fallback now warns once per model (only when the catalogues were actually asked), `raven doctor`'s `Context win` line says whether the number is pinned, from a catalogue, or the default, and the config health check reports the unpinned-and-unknown case.
3. **The id was not in LiteLLM's table.** `import_litellm` now registers `deepseek/deepseek-flash` (and the bare `deepseek-flash`) into the live table: window 1,048,576, output ceiling 384,000, DeepSeek's peak-hour prices. This is the dict the window resolver, the output-ceiling resolver and the cost recorder all read, so it also stops `cost_usd` being recorded as 0. A row a newer LiteLLM already carries is left alone; OpenRouter-routed ids are deliberately not registered.
Evidence is in the Curator's per-turn traces: `window=65536 out=49152 tools=10594 sys=1639 avail_hist=4151`, fallback path, `dropped message 32` (the assistant) with `included_message_ids: [35]` (one of its results). The session file itself was intact (34 calls, 34 results); after pinning the window the same session resumed on the fast path.
Not in this MR: the Curator's own calls are capped at `max_tokens=2048`, and on a model that reasons before answering two of six curator calls in one turn were cut with the last tool call unparsed, sending four turns in a row to the deterministic fallback. Left as it is -- it affects every product's every turn (up to 12 calls) and there is no comparison data; if it is raised it should be a config knob in its own MR.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `pytest tests/test_history_trimmer.py tests/test_curator_context_engine.py tests/test_provider_rates.py tests/test_litellm_setup.py tests/test_cli_doctor_window_line.py`: new cases -- a group drop removes the parent with all its results and a result with its parent and siblings; the history re-anchors on a user message after a drop; a result whose parent the session lost is not shipped; the fallback path records `errors` and ships no orphan; the default-window fallback warns once, not for a pin, not on the cheap tier; the registered row is present, reaches both resolvers, and does not override an existing row; the doctor line's three branches.
- Reverse check: with the three source files restored to `origin/main`, the new tests fail (trimmer 4, curator 1, rates 3, litellm_setup 3, doctor 1 import error); with the fix they pass.
- Wider run: `tests/test_agent_loop*.py tests/test_context*.py tests/test_curator*.py tests/test_memory*.py tests/test_litellm*.py tests/test_provider*.py tests/test_acp_*.py` + the above: 2799 passed, 38 skipped, 0 failed.
- `ruff check` / `ruff format --check` clean on every changed file.
- `tests/test_cli_doctor_commands.py` could not run in this environment (its autouse fixture needs `raven_everos`, 74 pre-existing errors on `main` too); the doctor line is covered by a separate file that needs only the resolver.
- End to end: the failing session (`~/.raven-ar6-ds`, 54 messages, one assistant with three parallel calls) resumed after the window was pinned; every request since carried the full history on the fast path.
## Risk
- Trimming semantics: a drop now removes a whole tool group where it removed one message; a budget that previously kept a partial group now keeps either all of it or none. The set of ids that survive can differ from before, but never in a way a provider rejects. Every existing test in the touched suites passes unchanged.
- `validation` gains an `errors` key on every path (previously only in `validate_candidate`); `ok` is now false when pairing is broken. Nothing in the tree read `ok` as budget-only.
- Registered prices are peak-hour; off-peak is half, and a flat table cannot say so, so recorded cost is an upper bound. Users on OpenRouter are unaffected (their ids are not registered).
- The new warning fires once per model per process; `allow_fetch=False` callers do not trigger it.
- Rollback: revert the three commits; no data or config involved.
## Related Issues
N/A
## Summary
Raven-Design disabled `spawn` and Raven-PPT did not, so the same deck request answered at
the top tier could start a sub-agent while the same request one tier down could not. The
asymmetry was not a decision -- the two config files were written separately -- and the one
recorded use shows what it costs.
A proposal deck's lane spawned a fact-check. `spawn` answered "I'll notify you when it
completes", and the next tool call went out in the same millisecond, so the deck was built
without the answer. The helper ran outside the turn's tier -- the launcher logged
`sub-agent Raven-Research-NG: offers no tier from medium/high/max; running on its own
default` -- and its late report arrived after delivery as a turn nobody had asked for.
Nothing needs it. No engine code calls `spawn`, the authoring skill never mentions it, and
across eight recorded product homes it was called once, on that run. Facts a deck needs are
fetched in the turn that needs them, with `web_search` and `web_fetch`: those answer inside
the tier, synchronously, and before the page is drawn.
`spawn` moves from the measured visible face to the config rows that hold the trunk's newer
tools out, and a test pins both deck lanes to the same dispatch set, so the next tool of
this kind cannot land on one lane only.
Two differences between the lanes are left alone, both deliberate: the deck lane disables
`image_generate` because `ppt_generate_image` replaces it, and disables the skill tools
because it mounts one authoring skill directly. Design also disables `message`, which is
not a dispatch tool and is out of scope here.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
```
uv run --frozen pytest tests/test_agents_ppt_launcher.py tests/test_agents_design_launcher.py -q
89 passed
```
The added test was confirmed to fail without the config change:
`test_neither_deck_lane_can_hand_its_work_to_a_helper_it_starts` asserts on the two
`config.json` files directly, and with the row stashed it fails on
`raven-ppt can still hand a deck to a helper it starts: ['spawn']`.
`spawn` also leaves `FORK_CONFIG_INTENT`, the set that pins the tool face an
`AgentLoop` built from the rendered config actually registers. Without that move
`test_the_products_tool_face_is_the_forks_config_intent_plus_the_deck` fails, which is the
check doing its job: the face is measured, not asserted twice.
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
One name joins a disable list, so the deck lane's model no longer sees `spawn` among its
tools. A deployment that relied on the deck lane starting helpers loses that; the recorded
behaviour suggests none does. Reverting the commit restores it.
## Related Issues
N/A