Repository navigation
Conversation
Windows compatibility review —
|
|
The head of this PR moved from The TUI half of #336's first item is folded in here rather than split into a second PR, because it builds on the module this one introduces. The diff now also covers the error event's new optional The Windows compatibility review above was pinned to |
Windows compatibility review —
|
2b43242 to
dae904c
Compare
Windows compatibility review —
|
|
Hi @LivXue, your Windows compatibility review for this PR (posted at head |
dae904c to
e245f93
Compare
Windows compatibility review —
|
The fix hint for a failed model call lived in the CLI alone, as a table next to the renderer that used it. A chat reader was told the category and the endpoint and nothing else, so a rate limit reached the room as a sentence with no advice attached. The knowledge now lives in one module, and each surface asks for the wording it can honour: a terminal is handed the command to run, a chat is handed what its reader can do -- no command, and the credential case pointed at the operator. The CLI's own output is unchanged, byte for byte. Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
The lint job runs ruff format --check over the tree, and the new test file was written by hand in a shape ruff would reformat. Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
A failed turn reached the TUI as the canonical line and stopped there, so a rejected key named the failure without naming a way out. The error event now carries the advice beside the detail, in the words the screen can act on, and the TUI closes the line with it when the runtime sent one.
e245f93 to
c5cc986
Compare
Windows compatibility review —
|
Summary
The fix hint for a failed model call lived in the CLI alone, and the screen that needed it most got nothing.
raven/cli/agent_commands.pyheld a table of category-apt hints next to the renderer that used it. A chat reader got nothing:raven/gateway/spine.pytold the channel the failure's category and endpoint and stopped there, so a rate limit reached the room as "The provider is rate limiting this account (openrouter). The runtime log has the provider's own account." -- a diagnosis with nothing to do about it. The TUI got even less: the error event carried the canonicaldetailand no advice, so a rejected key read asTurn failed - Error calling LLM (auth@openrouter): ...and stopped there.The knowledge now lives in one module,
raven/providers/error_hints.py, and each surface asks for the wording it can honour:Fix:line for a rejected key, theHint:line for the categories that have an apt one-liner, and no line at all for the ones that do not;The error event now carries the advice beside the detail.
raven/rpc/spine.py'semit_errortakes it and sends it when it has one, and the failed-turn sink derives it from the failure's category; a crash carries no category, so it gets no advice rather than a guessed one.rpc-schema/openrpc.json,raven/rpc/models.pyand both generated clients carry the new optionalhintfield, andui-tui'sturnErrorLinecloses the line with the advice when the runtime sent one. Every other reading of the frame -- a stop, an unrecognised code, a frame with no advice -- is unchanged.The channel reply still names the failure by its category and endpoint alone; the provider's own account stays in the operator's log, as before.
This is the first item of #336. The issue's second item -- the credential remedy the runtime already forwards but neither client renders -- is not in this change.
Type
Verification
Relevant tests pass locally
Relevant lint / type checks pass locally
Operator-facing docs or screenshots are updated when needed
PYTHONUTF8=1 uv run --frozen --python 3.12 pytest tests/test_rpc_spine.py tests/test_rpc_schema_match.py tests/test_rpc_registration.py tests/test_rpc_session.py tests/test_rpc_transport.py tests/test_acp_updates.py tests/test_gateway_spine.py tests/test_cli_agent_commands.py tests/test_provider_error_hints.py tests/test_error_classification.py -q->1339 passedPYTHONUTF8=1 uv run --frozen --python 3.12 pytest tests/test_rpc_spine.py tests/test_provider_error_hints.py tests/test_rpc_schema_match.py tests/test_rpc_registration.py tests/test_rpc_session.py -q --cov=raven.rpc.spine --cov=raven.rpc.models --cov=raven.providers.error_hints --cov-report=term-missing -o addopts=''->890 passed;raven/providers/error_hints.py15 statements, 0 missed, 100% covered, and no line the change touched is uncoverednpx vitest run src/__tests__/messages.test.ts src/__tests__/chatStream.test.ts src/__tests__/createGatewayEventHandler.test.ts src/__tests__/directEpisodes.test.ts(ui-tui) ->181 passedPYTHONUTF8=1 uv run --frozen --python 3.12 ty check raven/providers/error_hints.py raven/cli/agent_commands.py raven/gateway/spine.py raven/rpc/spine.py->All checks passed!make lint-python,make lint-types,make lint-imports,make lint-deps,make lint-tui,make lint-ui-> all passnode scripts/gen-rpc-types.mjs --check(ui-tui) ->OK: generated.ts in sync;npm run gen:check --prefix ui-webpassesmake check-source-language,make check-large-files,make check-commits-> all passRisk
Security impact considered
Backward compatibility considered
Rollback path is clear for risky changes
Security impact considered: nothing new reaches a reader. Each surface's advice is one sentence naming a screen or a retry; none carries vendor text, credential material or a command. The channel reply gains one sentence and keeps everything it had, and the credential case still points at the operator rather than naming a key. The CLI prints the same words it printed before, and the failure's own
detailis untouched on every surface.Backward compatibility considered: the CLI's rendered output is unchanged. The channel's reply grows by one sentence. On the wire,
hintis optional on both sides, so an older client ignores it and a newer runtime talking to an older client omits it; the rendered line grows by one sentence only when the runtime sent one, and a stop, an unrecognised code and an advisory-less failure read exactly as before.Rollback path is clear for risky changes: revert the commits.
Related Issues
#336