Absorbs the GitHub release into the downstream trunk. A merge rather than a
rebase so v0.1.11 becomes a real ancestor: the next sync then starts from
v0.1.11 instead of the July fork point, and the eventual contribution back to
GitHub can tell our commits from the upstream ones it already has.
Notable conflict resolutions, 19 hunks over 14 files:
* providers/litellm_provider.py takes upstream's wire_model delegation. Both
sides had fixed the same gateway-prefix bug; upstream moved the logic into
providers/wire.py and deleted _canonicalize_explicit_prefix, so keeping our
call would reference a method that no longer exists.
* cli/onboard_commands.py takes upstream's three-way file split. Our only
change to that file was _NON_CREDENTIAL_CHANNEL_FIELDS, ported to its new
home in cli/onboard_channels.py.
* agent/loop/main.py keeps our stream reconnect loop and grafts upstream's
terminal error-delta handling into it; takes upstream's _route_result_images
helper, which also covers the no-vision case our inline version did not, and
keeps our read_skill/use_skill reporting; takes upstream's ordering that
routes before assembly, since assembly decides whether an attachment is
inlined as a picture, while keeping our per-session model override.
* agent/subagent/manager.py keeps our backend dispatch and spawn history, and
threads the provider/model pair spawn snapshots into backend.run so a live
/model switch reaches subagents. The SubagentBackend protocol gained the
pair as optional keywords, travelling per call for the same reason workspace
already does.
Three breakages git merged cleanly and never flagged:
* web_rpc/methods_config.py imported six EverOS symbols from onboard_commands,
which upstream moved to onboard_everos.
* tui_rpc/methods/turn.py passed a single directory to _resolve_path, whose
third parameter we had changed to a tuple. Left as it was, an attachment was
dropped in silence whenever restrict_to_workspace is on.
* config/schema.py carried a second configuredness rule next to the one
upstream routes through providers.auth, so routing bypassed the
endpoints-first check and read a flat key that no request would use. It now
delegates, with include_external for parity with list_providers.
Verification: uv run ruff check passes; uv run pytest reports 6823 passed and
4 failed. All four fail on origin/main as well (one theme assertion, three
channel QR cases) and are left for a separate fix. Upstream's own 53 changed
test files pass, and so do our 85, which is what pins both sides' semantics
through these resolutions.
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
Land the accumulated core development from the ravenx workspace as a
single change on top of origin/main. It covers the gateway web-app RPC
channel, pluggable sub-agent execution backends with third-party CLI
and OpenAI-API presets, the sub-agent DAG subsystem and its TUI
surface, vendor-aware provider resolution, the deliverable token store
and the deliver_files tool, and the skill tool gating rework.
The web UI itself is deliberately excluded. ui-webui/ and
start_webapp.sh land separately, together with the lint ignores and the
third-party notice that reference them, because the repository asset
policy for that tree has to be settled first.
Condensed from 68 commits whose history predates this repository's
linear-trunk rule; the three-way merge against origin/main applied
without conflicts.
A follow-up commit fixes a stale assertion that arrived with the import:
read_local_body grew hub-shaped metadata and its test still described
the older four-key return.
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
## Summary
Closes out the provider path in one PR: the provider module redesign,
every
open issue and backlog item that lives on the identity / connection /
routing / capability axes, and multi-endpoint failover as a new feature.
78 commits, one problem per commit, rebased onto current main.
Redesign (base): four provider decisions were implemented outside
`raven/providers/` and had drifted copies -- wire form, credential
grammar,
pin resolution, price/window ladder, cache dialect. Each now has one
owning
module the surfaces call.
Fixes on that base, most visible first:
- The context window walks one ladder (explicit config > the model's
real
window > documented fallback). Previously the config default 65536 fed
trimming and budgets raw, so a 200k-window model lost two thirds of its
context every turn; an unresolvable window now renders the gauge's empty
state instead of a number that is nobody's. Construction and /model
switches resolve without touching the network, and a switch parked
behind
a running turn re-resolves the window at adoption, not at the RPC call.
- A provider without real streaming (azure, codex) no longer renders
upstream errors as normal assistant text: the terminal stream delta
carries the classification and joins the same recovery path the
non-streaming call uses. Both classify their non-200 from the live
status
code (shared ProviderHTTPError) instead of regex-guessing the rendered
text, which also removes the bare "404" substring match that misfiled a
400 whose body happened to embed one.
- Codex SSE failures keep their structured code, so an overloaded
backend
is retried instead of classified unknown.
- Orphan `</think>` recovery (backends launched without their reasoning
parser) is gated to the backend shapes that produce it, so ordinary
content mentioning the tag is never cut.
- Fallback hops are vetoed when both identities are certain and disagree
(previously a cross-vendor hop went out under the wrong key, or silently
to the wrong backend on a shared model name); the knn path dispatches
each hop to its own endpoint and inherits model_overrides through the
rotor.
- User model_overrides win over shipped extra_body defaults, and the
merge
no longer drops user keys behind a gateway.
- The credential gate, the reader and the builder answer one way: a
spec's
shipped default address satisfies the gate exactly when the reader would
serve it (custom runs on a bare key again, azure still demands its
address), endpoint entries inherit the flat api_base/extra_headers per
field, and every display face -- provider list, endpoint list, the TUI
picker -- reports the same resolved view, secrets redacted
(extra_headers
values included, on the flat section field too).
- The vision probe stops joining operator-chosen names against the
vendor
catalog: it reads through the TUI's lazy proxy to see the Azure
transport, treats an explicit-selection gateway (custom) as
caller-chosen, and the background catalog warm is no longer suppressed
for the life of the process by a stale on-disk table.
- Skill forge rewriter/gate follow the configured agent model (the only
auxiliary LLM calls that did not).
- The onboarding wizard refuses the six litellm vendors a bare API key
cannot configure, with the actual requirement named, instead of writing
a section that 401s forever.
- The OAuth handoff replays a signal swallowed mid-login, so a SIGHUP no
longer leaves a headless TUI.
New feature -- multi-endpoint failover (several accounts on one vendor):
- `providers.<name>.endpoints` (label / apiKey / apiBase / extraHeaders)
with `endpointStrategy: sticky | round_robin`; the three credential
spellings (explicit list, Gemini api_key_list, flat fields) resolve
through one reader with strict precedence and no key merging.
- `EndpointRotorProvider` rotates and fails over with per-endpoint
cooldown
(30s doubling to 300s, process-local state); auth failures rotate --
another account's key is exactly what a dead key needs -- while
endpoint-agnostic failures return immediately. Streams rotate only
before the first delta, so tokens are never replayed.
- Managed from `raven provider endpoint add|remove|list` and the TUI
model
picker; the session footer names the active endpoint. Write faces refuse
a keyless endpoint for key-credential providers (local deployments keep
their legitimate keyless shape); invalid sections fail loudly instead of
being read as empty and overwritten.
- Verified live twice: the rotor directly, and the full stack from a
config file through make_provider (a dead key 401s, cools, fails over,
answers). The first live run caught the auth-rotation gap the mocks
could not.
Also in this PR: the onboarding wizard split (5069 -> 3000 lines, pure
moves with every migrated monkeypatch target mutation-checked),
CONTEXT.md
terms (Provider Endpoint, window ladder), benchmark alignment
(pinchbench
now prices through the shared ladder instead of a private drifted copy),
and the model picker reads the config twice per open instead of twice
per
provider row.
Reviewed adversarially across three external rounds and four internal
panel rounds on two model families: 24 before-merge findings raised in
total, every one either fixed with a mutation-verified test or refuted
with executed evidence (one reviewer finding was withdrawn after a
945-case main-parity sweep); final verdicts RATIFY. The rebase also
adopted the review notes left on #282/#285 that landed on this code:
image-capability verdicts are invalidated on a provider switch, and a
parked switch logs its park and its adoption.
Known follow-ups, named in the review thread (issues to follow): the
fallback routing loop contradicts the registry's explicit-selection note
for `custom` (pre-existing on main), the remaining bare status
substrings
in classify_error (429/5xx, pre-existing), per-hop identity rebuilding
for
fallback chains, and the pre-existing SessionInfo shape mismatch.
## Type
- [x] Feature
- [ ] Fix
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
- `uv run pytest tests/ -q` -- 6128 passed, 33 skipped, run after the
rebase onto current main; the provider-path test files additionally
re-run under an empty HOME with identical results.
- `make lint-python` clean; commit messages pass commitlint and
scripts/check_commit_messages.py across all 78 commits.
- `cd ui-tui && npm run lint && npx tsc --noEmit && npx vitest run` --
86
files, 982 tests passed; `npm run gen:rpc -- --check` in sync.
- Live probes (OpenRouter, tiny max_tokens): rotor failover and
full-stack
assembly failover, both passing; logs kept locally.
- Fixes are pinned by deletion mutations that turn a named test red;
review rounds ran 22 such mutations and the two survivors were
themselves fixed (one dead guard deleted, one vacuous test replaced).
## Risk
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
User-visible behavior changes: `contextWindowTokens` unset now resolves
to
the model's real window (explicit values are fully respected and no
longer
overridden); the context gauge shows an empty state when the window is
unknown; azure/codex upstream errors surface as errors instead of
assistant text; the wizard refuses six key-only-unconfigurable vendors
with the real requirement named; `custom` with only an apiKey starts
again
(as on main) and the picker no longer demands an address the gate does
not; key-credential providers refuse keyless endpoints at write time and
`endpoint add --api-key` becomes optional for local deployments;
endpoint
keys and extra_headers values are redacted in `provider get`/`list` and
over RPC; a model switch logs when it parks behind a running turn and
when
it adopts. Rollback is a straight revert of the squash commit; no data
migration is involved (config additions are opt-in fields).
## Related Issues
Fixes#124, fixes#234, fixes#155, fixes#152, fixes#254, fixes#151,
fixes#143, fixes#144, fixes#197. References #281 (not reproducible on
current or reported code; the api_key forwarding it suspected is now
pinned
by regression tests), #119 (already fixed by #116; remaining item is the
installer redirect, not provider code).
---------
Co-authored-by: Claude (claude-opus-5[1m]) <noreply@anthropic.com>
## Change description
> Whole-repo lint + pre-commit convention, CONFIG ONLY (no source
reformat in this PR). Python (ruff) and TypeScript (eslint + prettier)
share a 120-col margin via the committed pre-commit gate. This upgrades
main's existing basic ruff setup and adds the TS lint stack (none
existed on main).
>
> What this PR adds:
> - ruff: line-length 120; security rules
S101/S105/S106/S107/S506/S605/S607; policy per-file-ignores (tests +
accepted CLI deferred-imports + product asserts + N818, each commented);
ruff pinned <0.16.
> - eslint/prettier: shared base (`eslint.base.mjs` +
`prettier.config.mjs`); ui-tui extends it with React rules, bridge with
a Node-only config; hermes-ink vendor and generated RPC types excluded.
> - pre-commit: keeps main's hooks (conventional-commit,
detect-private-key, etc.), adds a top-level exclude and 4 local
eslint/prettier hooks; bumps the pre-commit dev dep.
> - 2 lint-surfaced fixes: PlannerContext import (F821) in the sentinel
runner; lower-cased file-local cron-heartbeat constants (N806).
(raven/config/raven.py's F821 was already fixed on main.)
>
> Sequencing: config only. `ruff check` is intentionally red on ~307
auto-fixables (I001/F401/F541/E701/E702); a SEPARATE reformat branch
runs `ruff --fix` + `ruff format` + eslint/prettier --fix to clear them
(100% auto-resolvable, zero manual). Enforcement (pre-commit install /
CI) turns on only after the reformat lands, so do not expect a green
tree from this PR alone.
>
> CLI-owned files (the reformat and several per-file-ignores touch
`raven/cli/*`) are under review by the CLI team. Judgment items (TS
no-explicit-any, no-unused-expressions, S101 convert-vs-keep, N818
rename, C90, mypy) are deferred to v2.
## Type of change
- [ ] Bug fix
- [x] New feature
- [ ] Document
- [x] Others
## Related issues (if there is)
> none
## Checklists
### Development
- [ ] Lint rules pass locally
- [ ] Application changes have been tested thoroughly
- [ ] Automated tests covering modified code pass
> config-only: `ruff check` is red on auto-fixables by design (the
reformat branch clears them); eslint/prettier configs load in both
ui-tui and bridge.
### Security
- [x] Security impact of change has been considered
- [ ] Code follows company security practices and guidelines
> Only dependency change is the dev-only pre-commit tool plus the ruff
pin; the detect-private-key hook from main is retained.
### Code review
- [x] Pull request has a descriptive title and context useful to a
reviewer
- [ ] Pull request linked to JIRA ticket when applicable
---------
Co-authored-by: Sheng Zhao <sheng.zhao@evermind.ai>
Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>