fix(hub): resume Claude SDK sessions

This commit is contained in:
2026-07-08 11:48:20 +08:00
parent 012c8a7d89
commit c73b41e1da
5 changed files with 108 additions and 50 deletions
@@ -29,6 +29,12 @@ conversion. The SDK's `query()` owns the agent loop (tool dispatch, compaction,
streaming). Built-in tools (Read, Write, Bash, Glob, Grep) cover the entire
tool surface — no custom tools needed. `cph check` / `cph build` run via Bash.
The Hub `AgentSession` remains provider/model-bound, but it must persist the
provider runtime cursor needed to continue a conversation. For Claude Code SDK,
that cursor is the `result.session_id`; store it in `AgentSession.metadata` as
`claudeSessionId` and pass it back to the next `query()` call as
`options.resume`.
Environment variables:
```
ANTHROPIC_BASE_URL=https://openrouter.ai/api