[RAI-26994] Route Create/Search Tasks through 2.0 API for 2.0 users - #30145
[RAI-26994] Route Create/Search Tasks through 2.0 API for 2.0 users#30145ajohnson1200 wants to merge 4 commits into
Conversation
The Raycast task commands always used the Reclaim 1.0 /tasks endpoints, so
tasks created by users on Reclaim 2.0 ("Assistant") never appeared in the 2.0
tasks activity. Detect 2.0 via user.features.assistant.enabled and route the
Create Task and Search Tasks commands to the 2.0 /reclaim-tasks endpoints.
- Add features.assistant.enabled to the User type and expose isAssistantEnabled
from useUser.
- Add the 2.0 ReclaimTask model, request types, a priority guard, and a
reclaimTaskApiId helper that strips the "RECLAIM:" prefix (the {id} endpoints
expect the bare numeric id).
- Add useReclaimTask hooks for list/create/update/done/incomplete against
/reclaim-tasks.
- Add a leaner ReclaimTaskList view (title, priority, due, done/incomplete,
open) since the 2.0 model has no chunk/instance/up-next data.
- Branch Search Tasks and Create Task on the flag; hide 1.0-only form fields
(duration min/max, time policy, up-next) for 2.0 users.
Verified end-to-end against a live 2.0 account: create (201), search (200),
mark done/incomplete (200).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thank you for your contribution! 🎉 🔔 @lightbody @gunrein @clayton-knapp @SandyGifford you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="reclaim-ai-2.0-tasks"
FORK_URL="https://github.com/ajohnson1200/raycast-extensions.git"
EXTENSION_NAME="reclaim-ai"
REPO_NAME="raycast-extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. |
Greptile SummaryThe PR routes task creation and search through the Reclaim 2.0 API for Assistant-enabled accounts.
Confidence Score: 4/5The PR does not yet appear safe to merge because stale cached account state can still route task creation to the wrong API. The attempted user-loading fix protects an empty cache, but a stale cached user keeps the form interactive while its Assistant flag is refreshed, leaving the previously reported endpoint-misrouting failure reachable. Files Needing Attention: extensions/reclaim-ai/src/task-form.tsx and extensions/reclaim-ai/src/hooks/useUser.tsx Important Files Changed
Prompt To Fix All With AI### Issue 1
extensions/reclaim-ai/src/task-form.tsx:220-226
**Stale flag misroutes submission**
When a cached user's Assistant flag has changed, `currentUser` remains non-null while its stale value is refreshed, so this gate leaves the form interactive and `handleSubmit` selects the wrong task API, causing the task to be rejected or created outside the user's active task pool.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (4): Last reviewed commit: "Merge branch 'main' into reclaim-ai-2.0-..." | Re-trigger Greptile |
The loading guard keyed off isLoading, which starts true on every mount. A cached user is populated synchronously from the Cache, so gating on isLoading showed an unnecessary loading flash (and briefly withheld the 1.0 TaskList's own loading state) while a background /users/current refresh ran. Gate on "no user yet AND loading" so the correct view renders immediately when a cached user is present. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
isAssistantEnabled selects the 1.0 /tasks vs 2.0 /reclaim-tasks create endpoint, but the form's loading state only tracked time policies. On an uncached first run currentUser could still be null at submit time, so a 2.0 user's task was mis-routed to the legacy endpoint. Fold the initial user load into the form's isLoading gate and guard handleSubmit so it refuses to submit until the user is known. A cached user is present synchronously, so this only gates a cold start. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0xdhrv
left a comment
There was a problem hiding this comment.
Hi @ajohnson1200 👋
Thanks for the contribution 🔥
Could you look into the suggestions from Greptile?
I converted this PR into a draft until it's ready for the review, please press the button Ready for review when it's ready and we'll have a look 😊
|
I've addressed the individual comments from greptile (all of which were very minor), this should be ready to go. NOTE: I'm an employee of Reclaim, not just a random contributor. |
Description
The Raycast task commands always used the Reclaim 1.0 /tasks endpoints, so tasks created by users on Reclaim 2.0 ("Assistant") never appeared in the 2.0 tasks activity. Detect 2.0 via user.features.assistant.enabled and route the Create Task and Search Tasks commands to the 2.0 /reclaim-tasks endpoints.
Verified end-to-end against a live 2.0 account: create (201), search (200), mark done/incomplete (200).
Screencast
n/a
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool