SYM-212: add foundational thread RPC query hooks#1272
SYM-212: add foundational thread RPC query hooks#1272senamakel merged 2 commits intotinyhumansai:mainfrom
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
useThreads()anduseThreadMessages(threadId)hook foundations over the existingthreadApiRPC client.data,loading,error,isRefetching, andrefetch()states without migrating chat/runtime consumers yet.Problem
The broader thread cache migration is too large for one PR. The app needs a small tested hook layer over the existing thread RPC API before consumers can migrate safely.
Solution
A new
app/src/hooks/useThreadQueries.tsmodule wrapsthreadApi.getThreads()andthreadApi.getThreadMessages()with lightweight React state and debug logging. This PR does not changeChatRuntimeProvider, streaming behavior, orConversations.tsxconsumers.Submission Checklist
docs/TESTING-STRATEGY.mddiff-cover) meet the gate enforced by.github/workflows/coverage.yml. Runpnpm test:coverageandpnpm test:rustlocally; PRs below 80% on changed lines will not merge.docs/TEST-COVERAGE-MATRIX.mdreflect this change (N/A: internal hook foundation only)## Related(N/A: no matrix feature IDs affected)docs/TESTING-STRATEGY.md)docs/RELEASE-MANUAL-SMOKE.md) (N/A: not a release-cut surface)Closes #NNNin the## Relatedsection (N/A: Linear issue plus upstream tracking issue only)Impact
No user-visible behavior change. This is a foundation for later thread UI/cache migration work.
Related
useThreads(); migrate non-streaming message reads touseThreadMessages(threadId)after reviewing runtime ownership.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
codex/SYM-212-thread-rpc-query-hooks01fb74cfa1b041f3d35766a44531dfbe3ab7105eValidation Run
pnpm --filter openhuman-app format:checkvia focusedpnpm --dir app exec prettier --check src/hooks/useThreadQueries.ts src/hooks/useThreadQueries.test.tspnpm typecheckviapnpm --filter openhuman-app compileBlocker regression:
pnpm --dir app exec vitest run src/hooks/useThreadQueries.test.ts --config test/vitest.config.tsFocused format after blocker patch:
pnpm --dir app exec prettier --check src/hooks/useThreadQueries.ts src/hooks/useThreadQueries.test.tsTypeScript compile after blocker patch:
pnpm --filter openhuman-app compileRust fmt/check (if changed): N/A, no Rust changed
Tauri fmt/check (if changed): N/A, no Tauri changed
Validation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
threadApiRPC methods remain the backing source of truth.Duplicate / Superseded PR Handling