Skip to content

fix: declare orjson as a direct dependency#116

Merged
0xKT merged 1 commit into
mainfrom
fix/declare_orjson_dependency
Jul 13, 2026
Merged

fix: declare orjson as a direct dependency#116
0xKT merged 1 commit into
mainfrom
fix/declare_orjson_dependency

Conversation

@arelchan

Copy link
Copy Markdown
Contributor

Change description

Fixes a fresh-install crash where every real turn fails with
APIConnectionError: OpenrouterException - No module named 'orjson'
(shown in the TUI as the generic turn_failed (code=-32099)).

Root cause: litellm's request path imports orjson at runtime, but litellm
only declares it under its proxy extra, which raven does not install. So
orjson was absent from raven's dependency graph entirely (not in
pyproject.toml, not in uv.lock). Any install (git clone && uv sync, or
the release wheel) therefore lacked it, and the first message a user sends
crashes the turn.

Fix: declare orjson as a direct runtime dependency so every install
resolves it.

Verified locally: a turn that previously failed with the missing-orjson
error now completes normally after the dependency is declared.

Type of change

  • Bug fix
  • New feature
  • Document
  • Others

Related issues

Closes #113

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered
  • Code follows security best practices and guidelines

Code review

  • Pull request has a descriptive title and context useful to a reviewer

@arelchan
arelchan requested a review from 0xKT July 13, 2026 08:51
litellm's request path imports orjson at runtime, but litellm only
declares it under its 'proxy' extra, which raven does not install. orjson
was therefore absent from the dependency graph (not in pyproject or
uv.lock), so a fresh install lacked it and every real turn failed with
'APIConnectionError: OpenrouterException - No module named orjson',
surfaced in the tui as the generic 'turn_failed (code=-32099)'.

Declare orjson as a direct runtime dependency, mirroring litellm's own
constraint (>=3.11.6,<4.0). Verified: a turn that previously failed now
completes normally.

Closes #113

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@0xKT
0xKT merged commit 4a57d4e into main Jul 13, 2026
8 checks passed
@0xKT
0xKT deleted the fix/declare_orjson_dependency branch July 13, 2026 13:36
@0xKT 0xKT mentioned this pull request Jul 13, 2026
8 tasks
arelchan pushed a commit that referenced this pull request Jul 13, 2026
## Summary

Bump project version 0.1.3 -> 0.1.4 to cut the next patch release. Ships
the four fixes/features merged since v0.1.3: `raven upgrade` command
(#112), onboard oauth browser login (#110), plugin dir on sys.path
(#92), and orjson as a direct dependency (#116). Lockfile synced via `uv
lock`.

## Type

- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [x] Other

## Verification

- [x] Relevant lint / type checks pass locally

```
python3 scripts/check_commit_messages.py origin/main..HEAD   # pass
uv lock                                                       # raven 0.1.3 -> 0.1.4
```

## Risk

- [x] Backward compatibility considered

Version-only bump; no runtime code changed. The release tag (v0.1.4) is
pushed after this merges.

## Related Issues

N/A

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing 'orjson' dependency causes APIConnectionError on fresh install

2 participants