feat: migrate scrape proxy to chittyagent-scrape SDK worker - #50
Conversation
Updates routerClient to proxy scrape operations to the new chittyagent-scrape worker (chittyidentity SDK) instead of ChittyRouter's ScrapeAgent Durable Object. - Adds CHITTYAGENT_SCRAPE_URL env var for direct agent routing - scrapePost/scrapeGet helpers try agent first, fall back to router - Enqueue maps to POST /api/v1/enqueue (agent-tasks queue) - Process maps to POST /api/v1/process - Health maps to GET /health Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
To use Codex here, create a Codex account and connect to github. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds support for a new chittyagent-scrape integration by introducing a configuration environment variable and refactoring scrape-related proxy methods in the integrations module. Methods are updated to call new agent endpoints with modified request shapes and parameters, with fallback to legacy router paths. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant routerClient
participant Agent as Scrape Agent
participant Legacy as Legacy Router
Client->>routerClient: enqueueScrapeJob(jobType, target, opts)
alt CHITTYAGENT_SCRAPE_URL is set
routerClient->>Agent: POST /api/v1/enqueue<br/>(with mapped fields)
Agent-->>routerClient: Response
alt Response OK
routerClient-->>Client: Return result
else Response Error
routerClient->>Legacy: POST /agents/scrape/enqueue<br/>(fallback)
Legacy-->>routerClient: Response
routerClient-->>Client: Return result
end
else CHITTYAGENT_SCRAPE_URL not set
routerClient->>Legacy: POST /agents/scrape/enqueue
Legacy-->>routerClient: Response
routerClient-->>Client: Return result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
chittyagent-scrapeworker in the chittyidentity SDK monorepoCHITTYAGENT_SCRAPE_URLenv var for direct agent routingChanges
src/index.ts— AddedCHITTYAGENT_SCRAPE_URLto Env typesrc/lib/integrations.ts— AddedscrapePost/scrapeGethelpers that try chittyagent-scrape first, fall back to ChittyRouterTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Updates