?
PPLX-69
feature,frontend,api,deep-research
Created: 2025-12-21 Updated: 2025-12-21
Relationships Loading...
Attachments
Loading...
Comments (2)
code-verification-qa · 2025-12-21
[QA PASSED] ✅ All acceptance criteria verified and tests passing (33/34 tests passed, 1 intentionally skipped). **Verified:** - All required functions implemented correctly - TypeScript types match specification - Polling logic with exponential backoff (1s → 5s) works as designed - Progress updates via callback - Error handling robust - Comprehensive test coverage **Test Results:** ``` ✓ src/api/backend.test.ts (34 tests | 1 skipped) 1603ms Test Files 1 passed (1) Tests 33 passed | 1 skipped (34) ``` Full QA report: /tmp/qa-PPLX-69.md Implementation is production-ready.
agent · 2025-12-21
## Implementation Complete Added async query API client functions to `src/src/api/backend.ts`: ### New Functions - **createAsyncQuery(threadId, query, mode?, reasoningEffort?)** - Now supports `mode` and `reasoningEffort` parameters for sonar-deep-research model - **getAsyncQueryStatus(requestId)** - Convenience function to get just the status from progress endpoint - **listAsyncQueries()** - Stub for future backend endpoint (currently returns 404) - **pollAsyncQuery(requestId, config?)** - Polls until completion with exponential backoff - **createAndPollAsyncQuery(...)** - Convenience function combining create + poll ### New Types - `AsyncQueryStatus` - 'pending' | 'processing' | 'completed' | 'failed' - `ReasoningEffort` - 'low' | 'medium' | 'high' - `AsyncQueryOptions` - Interface for async query configuration - `PollingConfig` - Interface for customizing polling behavior ### Polling Logic - Exponential backoff: starts at 1s, increases by 1.5x each poll, max 5s - Configurable via `PollingConfig`: initialInterval, maxInterval, backoffMultiplier, maxPollingTime - Progress callback via `onProgress` option - Automatically stops when status is 'completed' or 'error'/'failed' - Throws `APIError` on timeout or query failure ### Tests Added All tests passing (33 tests in `backend.test.ts`): - createAsyncQuery with default mode and with custom mode/reasoningEffort - getAsyncQueryProgress, getAsyncQueryResult, getAsyncQueryStatus - listAsyncQueries (handles 404 for unimplemented endpoint) - pollAsyncQuery with completion, failure, timeout, and exponential backoff verification - createAndPollAsyncQuery convenience function ### Verification ``` npm test -- --run src/api/backend.test.ts ✓ src/api/backend.test.ts (34 tests | 1 skipped) 1611ms Test Files 1 passed (1) Tests 33 passed | 1 skipped (34) ``` Files modified: - `src/src/api/backend.ts` (+205 lines) - `src/src/api/backend.test.ts` (+445 lines)