Skip to content

[RAI-26994] Route Create/Search Tasks through 2.0 API for 2.0 users - #30145

Open
ajohnson1200 wants to merge 4 commits into
raycast:mainfrom
ajohnson1200:reclaim-ai-2.0-tasks
Open

[RAI-26994] Route Create/Search Tasks through 2.0 API for 2.0 users#30145
ajohnson1200 wants to merge 4 commits into
raycast:mainfrom
ajohnson1200:reclaim-ai-2.0-tasks

Conversation

@ajohnson1200

Copy link
Copy Markdown
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.

  • 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).

Screencast

n/a

Checklist

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>
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: reclaim-ai Issues related to the reclaim-ai extension platform: macOS platform: Windows OP is contributor The OP of the PR is a contributor of the extension labels Aug 11, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

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 commands
BRANCH="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 dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR routes task creation and search through the Reclaim 2.0 API for Assistant-enabled accounts.

  • Adds Reclaim 2.0 task models, hooks, actions, and a dedicated task list.
  • Branches task search and creation using the user feature flag.
  • Adjusts the task form to omit legacy-only fields for Assistant users.

Confidence Score: 4/5

The 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

Filename Overview
extensions/reclaim-ai/src/task-form.tsx Adds Assistant-aware creation and form fields, but stale cached user state can still select the wrong endpoint during refresh.
extensions/reclaim-ai/src/hooks/useUser.tsx Exposes the Assistant feature flag from synchronously cached and asynchronously refreshed user state.
extensions/reclaim-ai/src/list-tasks.tsx Selects the legacy or Reclaim 2.0 task list after initial user resolution.
extensions/reclaim-ai/src/components/ReclaimTaskList.tsx Adds the lean Reclaim 2.0 task-list UI and completion actions.
extensions/reclaim-ai/src/hooks/useReclaimTask.tsx Adds list, create, update, complete, and incomplete operations for Reclaim 2.0 tasks.
extensions/reclaim-ai/src/types/reclaim-task.ts Defines the Reclaim 2.0 API models, priority conversion, and namespaced-ID normalization.
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

Comment thread extensions/reclaim-ai/src/list-tasks.tsx Outdated
Comment thread extensions/reclaim-ai/src/task-form.tsx Outdated

@gunrein gunrein left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@raycast-extensions-bot raycast-extensions-bot Bot added the Approved Approved by a user label Aug 11, 2026
ajohnson1200 and others added 3 commits August 11, 2026 14:54
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>
Comment thread extensions/reclaim-ai/src/task-form.tsx

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😊

@0xdhrv
0xdhrv marked this pull request as draft August 12, 2026 04:35
@0xdhrv 0xdhrv self-assigned this Aug 12, 2026
@ajohnson1200
ajohnson1200 marked this pull request as ready for review August 12, 2026 15:54
@ajohnson1200

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved by a user extension fix / improvement Label for PRs with extension's fix improvements extension: reclaim-ai Issues related to the reclaim-ai extension OP is contributor The OP of the PR is a contributor of the extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants