Conversation
Code Review: Siri Integration with Push NotificationsThank you for this well-structured PR! The Siri integration with push notifications is a great addition. Here's my feedback: ✅ Strengths
🔴 Critical Issues1. Polling Loop in Background Task Violates Worker Limits (worker/index.ts:582-622)The
Problem: The polling loop with Recommendation: Use a different architecture:
2. Device Token Not Retrieved in Background Processing (worker/index.ts:1257-1270)In Recommendation: In
|
Address PR review feedback with several improvements: - Replace Worker polling loop with Cloudflare Queue-based approach to avoid violating Worker CPU time limits - Fetch device token from storage if not provided in request - Add AbortSignal.timeout to all fetch calls - Add max poll count (20) and max time (90s) limits with backoff - Add input validation for prompt length (max 10000 chars) - Fix Swift JSON serialization error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Match the iOS app behavior - use workspace.name (e.g., "feature-api-docs") instead of workspace.path for the PTY session query parameter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Increase SIRI_MAX_POLL_TIME_MS from 2 minutes to 5 minutes - Remove redundant SIRI_MAX_POLL_COUNT check (time-based is sufficient) - Log elapsed time instead of poll count on timeout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add SIRI_POLL_INTERVAL_SECONDS constant (10 seconds) to control the delay between queue polling invocations. Previously hardcoded to 3-5 seconds in various places. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
…ties Remove Siri App Intents feature while preserving APNs push notifications and Live Activity support for codespace creation progress tracking. Removed: - Siri intent files (SendPromptIntent, CheckStatusIntent, AppShortcuts) - /v1/siri/prompt and /v1/siri/status endpoints - Siri prompt queue and polling logic - Siri entitlement from app capabilities Kept: - APNs push notification infrastructure (worker/apns.ts) - Live Activity registration and progress updates - Device token storage for future notification use - Production APNs environment in entitlements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Disable runsForEachTargetApplicationUIConfiguration to prevent testLaunch from running for every UI configuration (was causing timeouts in CI) - Move notification permission request from app launch to when user actually installs Catnip or creates a codespace (prevents dialog from blocking UI tests) - Simplify CodespaceButtonTests to look for mock repository names instead of section headers (more reliable in accessibility tree) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
SendPromptIntent: "Send a prompt to Claude in Catnip"CheckStatusIntent: "What's Claude working on in Catnip"waitUntilpatternPOST /v1/siri/prompt- queues prompt, returns immediately, sends push when doneGET /v1/siri/status- returns workspace status for voice feedbackArchitecture
iOS App Intents → Cloudflare Worker → Codespace → Claude Code
↓
APNs Push Notification → iOS
Test Plan
pnpm typecheck:workerjust build(from xcode directory)Configuration Required
APNs secrets must be configured in Cloudflare:
APNS_AUTH_KEY- .p8 file contentsAPNS_KEY_ID- 10-character Key IDAPNS_TEAM_ID- Apple Team IDAPNS_BUNDLE_ID- com.wandb.catnip🤖 Generated with Claude Code