Skip to content

feat(clickup): rebase #9495 onto current main and fix task-reference parsing - #15788

Draft
heyramzi wants to merge 31 commits into
stablyai:mainfrom
heyramzi:feat/clickup-combined
Draft

heyramzi wants to merge 31 commits into
stablyai:mainfrom
heyramzi:feat/clickup-combined

Conversation

@heyramzi

Copy link
Copy Markdown
Contributor

ELI5

Orca can already start work from GitHub, GitLab, Linear and Jira tickets. This adds ClickUp to that list: connect a ClickUp account with a personal API token, browse your tasks in the Tasks panel, and start a workspace that stays linked back to the task — plus a orca clickup CLI and an orca-clickup agent skill so coding agents can read and update the task they are working on.

What Changed

This is @luizeof's #9495 rebased onto current main, with fixes. #9495 has been open since 20 Jul, is ~2,100 commits behind and currently conflicted; the work in it is good and this PR keeps it, so please credit @luizeof — I am not the author of the integration itself. Happy to close this in favour of #9495 if you would rather land that one.

Carried over from #9495 (unchanged in substance):

  • ClickUp main-process client, connection storage, task/list/comment reads and writes
  • Tasks panel surface, task detail sheet, create-task dialog, Settings → Integrations card
  • orca clickup CLI handlers and the bundled orca-clickup agent skill
  • Mobile task views, SSH/daemon plumbing, workspace-board ClickUp status sync
  • docs/reference/clickup-integration.md

Changed while rebasing:

  • Dropped the createWorktree named-options refactor that feat(clickup): add end-to-end issue tracker integration #9495 carried. It is a separate topic and was the source of most conflicts; ClickUp now rides main's existing options.linkedWorkItem extension point instead of two new positional parameters.
  • Moved the ClickUp types onto main's current layout — the shared/types barrel is gone (refactor(shared): drop the shared/types barrel and import from the real modules #14447) and provider identity now lives in task-provider-identity.ts.
  • Fixed a task-reference bug. src/cli/clickup-task-reference.ts parsed https://app.clickup.com/t/<workspaceId>/<ABC-12> as the workspace id rather than the custom task id, so orca clickup task <url> looked up the wrong thing for any workspace using custom task ids. CLI, composer and worktree linking now share one src/shared/clickup-task-url.ts, which also rejects plaintext http, explicit ports and embedded credentials. Covered by 25 tests.
  • Renamed clickUpTaskId → clickupIdentifier on the linked work item, matching the existing linearIdentifier / jiraIdentifier fields, and added clickupWorkspaceId because a native /t/<id> URL does not name its Workspace.
  • De-duplicated the task-source provider label into task-source-provider-label.ts rather than adding a third copy of the same switch.
  • Extracted mobile/src/tasks/task-repository-grouping.ts so mobile/app/h/[hostId]/tasks.tsx stays under its existing per-file cap instead of raising it (AGENTS.md forbids raising it).
  • One-shot settings migration reveals ClickUp for profiles saved before it shipped, matching the Jira visibleTaskProvidersDefaultedForJira pattern, and honours a deliberate opt-out.

Why

Fixes #14622, which asks for exactly this and notes #10389 as the earlier thinner request. #9495 already implements it well; the only thing standing between that work and a merge is that upstream has moved ~2,100 commits underneath it. This PR is that rebase, done once, with the four gates green.

Linked Issue

Fixes #14622

Visual Proof

Testing

  • pnpm typecheck — clean across the node, cli and web projects

  • pnpm lint — clean, including the five localization audits and the max-lines ratchet

  • pnpm test — 56,836 passed. The 21 remaining failures are all in git/relay/shell-startup/daemon suites this PR does not touch: real-git and live-shell tests timing out under local memory pressure, plus a stale tests/e2e/.cross-version-checkouts/ directory from an earlier local run. Worth a CI confirmation.

  • New: src/shared/clickup-task-url.test.ts (URL/custom-id/host/scheme cases), ClickUp visibility-migration cases in src/main/persistence-source-control-ai-migration.test.ts

  • I manually tested these changes locally

  • Automated tests added/updated

AI Disclosure

Claude Opus 5 performed the rebase, conflict resolution and the fixes listed under "Changed while rebasing". The underlying ClickUp integration is @luizeof's work from #9495.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security — the token is stored through the existing encrypted-credential path with the ClickUp service tag, and decrypt failures surface as a credential error rather than a silent disconnect. The shared URL parser now refuses http, non-default ports and embedded credentials, so a downgraded or lookalike link cannot become a trusted task reference.
  • Cross-platform — no new platform-dependent code; credential paths go through the existing helpers.
  • Remote SSH — every ClickUp call goes through the runtime RPC target like Linear and Jira, so the selected runtime owns the credential. The agent skill states that a remote runtime needs its own connection.
  • Mobile — the mobile task views from feat(clickup): add end-to-end issue tracker integration #9495 are carried over and compile against current main.
  • Backwards compatibility — new settings and worktree fields are all optional; the visibility migration is a one-shot stamp that respects an explicit opt-out.
  • Performance — reads are pooled at 4 concurrent requests. ClickUp meters personal tokens at 100 requests/minute.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint and pnpm typecheck pass locally; pnpm test green apart from the pre-existing local-environment failures noted above

luizeof and others added 30 commits July 19, 2026 20:14
Add ClickUp as a first-class task provider alongside Linear, including shared task models, encrypted Personal API token storage, workspace and list hierarchy discovery, task search and CRUD operations, comments, assignees, tags, priorities, statuses, and due dates.

Expose the integration through IPC, RPC, local and remote runtimes, preload APIs, the web client, and the orca clickup CLI. Persist ClickUp links in local, SSH, relay, and folder worktrees, and support task-aware worktree creation plus --current CLI operations.

Add the complete renderer experience: connection settings, provider visibility, task list and detail surfaces, task creation and editing, comments, Smart Workspace search, feature-wall detection, sidebar navigation, and Kanban status synchronization using the existing design system.

Bundle the ClickUp agent skill and CLI guide, migrate provider defaults without overriding deliberate opt-outs, and add localized copy for every supported locale.

Cover the client, RPC, CLI, persistence, provider migration, worktree metadata, SSH passthrough, renderer store, Smart Workspace, and board synchronization paths with tests.

Add a fork-scoped GitHub Actions workflow that builds and uploads unsigned Apple Silicon and Intel DMG/ZIP artifacts only from luizeof/orca:clickup-issues.
Apply a 30-second AbortSignal to ClickUp net.fetch calls so stalled requests release the concurrency slot. Treat token decryption failures as a disconnected state and cover both behaviors with focused tests.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
Scan raw ClickUp pages until the requested client-side filter/search limit is satisfied, using the raw response size so normalization cannot terminate pagination early. Run every tag mutation with allSettled and report the exact failed operations. Centralize required-client selection shared by task and workspace modules.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (review)
Reject malformed priority, due-date, and time-estimate values before local task creation reaches ClickUp. Keep the equivalent RPC schemas concise with nullish fields and cover invalid IPC payloads.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (review)
Use the shared Textarea primitive for task editing, always release comment/test loading states after rejected requests, and patch known task fields before the forced refresh. Force the task cache once per refresh nonce instead of permanently bypassing it. Localize connection status and singular/plural Workspace copy, with catalog parity across locales.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
Apply the same 15-60 second operation-specific limits to local window.api ClickUp calls that remote runtime RPC calls already use, preventing UI actions from waiting indefinitely on a stalled IPC request.

Review comment:
- stablyai#9495 (comment)
Prefix local-runtime cache entries with an explicit sentinel so unscoped patches cannot mutate task-source caches. Ignore search/list writes that finish after a connection or Workspace mutation, refresh the status context key on Workspace selection, and extract cache policy to keep the slice within the line limit. Cover local-versus-explicit scope isolation and stale read races.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (comment)
Document and verify that omitted runtime settings intentionally select the local runtime for ClickUp board synchronization. Returning early for undefined settings, as suggested by the review, would disable the valid local path.

Review comment:
- stablyai#9495 (comment)
Extend Smart Workspace source intent with ClickUp and prioritize the matching ClickUp row when the picker is in ClickUp mode. Add a resolver regression test so Enter cannot fall back to the typed-name row for an explicit ClickUp lookup.

Review comment:
- stablyai#9495 (comment)
Set persist-credentials to false on the development macOS checkout so the workflow token is not written into local Git configuration or carried into build artifacts.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
Normalize list filters case-insensitively, use a comment-specific success message, preserve all five TSV destination columns, and validate real calendar dates. Document launcher worktree-ID precedence and add negative coverage for selector conflicts, missing links, filters, priorities, and due dates.

Review comments:
- stablyai#9495 (comment)
- stablyai#9495 (comment)
- stablyai#9495 (review)
- stablyai#9495 (review)
Merge upstream/main into clickup-issues without rewriting the review-fix commits. Resolve the five generated locale catalog conflicts by retaining the current main catalogs and regenerating all ClickUp and upstream keys from the merged source, preserving parity across en, es, ja, ko, and zh.

Validation:
- pnpm typecheck
- 54 focused ClickUp/CLI/board/cache tests
- localization catalog and coverage checks
- max-lines ratchet
Introduce CreateWorktreeOptions and migrate every renderer caller and affected assertion to named fields. This removes the fragile 28-argument contract, makes provider metadata explicit, and preserves local, SSH, WSL, runtime, automation, and ClickUp creation paths.

Addresses review: stablyai#9495 (review)
Replace semantic ClickUp-only keys with deterministic 10-character catalog keys alongside their neighboring components. Pass count through singular and plural workspace descriptions, migrate every locale catalog, and remove the superseded entries.

Addresses review: stablyai#9495 (review)
Add --clickup-task and --clickup-workspace to the root Common Commands examples for both worktree create and worktree set, including the nullable unlink form. Extend root-help coverage so the summary cannot drift from the command specs again.

Addresses review: stablyai#9495 (review)
After the optimistic task patch, write the forced refresh result back through patchClickUpTask before notifying the detail-sheet owner. This keeps list, board, detail, and source-scoped caches aligned with server-normalized fields after a successful save.

Addresses review: stablyai#9495 (review)
Cast the Vitest mock call records to an explicit one-argument tuple before inspecting CreateWorktreeOptions. This keeps the refactor assertions compatible with the native TypeScript compiler used by the macOS packaging runner.

Addresses review: stablyai#9495 (review)

Fixes CI run: https://github.com/luizeof/orca/actions/runs/29715706025
Centralize ClickUp task reference parsing so task reads and mutations match worktree link behavior. Accept only plain task IDs or HTTPS app.clickup.com task URLs, normalize URLs before RPC calls, reject lookalike hosts, and expose the accepted id-or-url form in command help. Cover valid URLs, slugged URLs, malformed references, malicious hosts, and mutation dispatch.
Document ClickUp connection scoping and credential storage, desktop/mobile task workflows, CLI discovery and mutation commands, linked workspace behavior, SSH/runtime considerations, and troubleshooting. Describe the fork-only unsigned macOS workflow and local checkout commands, then link the guide from the English and Portuguese readmes.
Bring the ClickUp skill in line with the repository's Linear-style operational guidance. Clarify the CLI namespace, runtime-scoped credentials across local, WSL, SSH, and relay hosts, task URL support, exact non-regressive status selection, single-comment completion behavior, and safe handling of uncertain writes. Regenerate the distributed skill, embedded CLI guide, and bundle manifests, with contract tests for the new safety boundaries.
Expose ClickUp as a runtime-scoped mobile Tasks provider with connection-aware home shortcuts, search and assigned-task loading, task details and comments, provider branding, external links, and linked workspace creation. Add ClickUp to Smart Workspace discovery and fan-out, preserve task and Workspace IDs through create RPCs, and reject incomplete linked sources before mutation. Extract task item models and source-selection dispatch into domain-named modules so the existing max-lines budgets remain unchanged. Cover provider availability, task mapping, Smart mode fan-out, composer linking, workspace parameters, and invalid identity handling; update the integration guide to distinguish desktop editing from paired-mobile read/start behavior.
# Conflicts:
#	src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx
#	src/shared/types.ts
Brings stablyai#9495 onto today's main after the merge:

- keep main's positional createWorktree signature and route ClickUp
  through its existing options.linkedWorkItem, dropping the named-options
  refactor so this PR stays one topic
- move the ClickUp types onto main's post-barrel layout and add ClickUp
  to TaskProvider, the provider identity union and the linked-item schema
- share one ClickUp URL parser between the CLI, composer and worktree
  linking, fixing /t/<workspaceId>/<ABC-12> resolving to the workspace id
  and rejecting http, ports and embedded credentials
- rename clickUpTaskId to clickupIdentifier to match linearIdentifier
- de-duplicate the task-source provider label into one module
- extract mobile task grouping so the tasks screen stays under its cap

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01AR4JMQrgfPc7mteWTcpFKX
Upstream split ten of the files this branch touches into modules, so the
conflicts covered whole files while the ClickUp delta was small. Each
addition was re-applied where the code now lives rather than resolved in
place:

- runtime-types.ts        -> runtime-worktree-contracts.ts
- web-preload-api.ts      -> preload-api/web-worktrees-api.ts
- ipc/worktrees.ts        -> worktrees/folder-workspace-model.ts,
                             worktrees/create/folder-workspace-creation.ts
- loading-store/store.ts  -> prepare-loaded-profile-settings.ts,
                             normalize-loaded-global-settings.ts
- NewWorkspaceComposerCard -> new-workspace-composer-card-props.ts,
                              NewWorkspaceComposerNameSection.tsx
- useComposerState.ts     -> nine files under hooks/composer-state/
- WorkspaceKanbanDrawer   -> use-workspace-board-task-status-sync.ts
- mobile/app/index.tsx,
  NewWorktreeModal.tsx    -> mobile/src/home/*,
                             use-new-workspace-runtime-context.ts

CacheEntry moved to store/github/cache-model. PreparedFullSubmit,
PreparedQuickSubmit, ComposerDerivedModel and SmartWorkspaceUrlSourceMode
gained their ClickUp members.

check-runtime-electron-ratchet caught src/main/clickup/client.ts importing
electron directly, which breaks the node-only runtime graph. It now fetches
through the MainHttpClient port, as jira/authenticated-request.ts does, and
its test installs the port instead of mocking electron net.
register-core-handlers.ts moved into its own directory, so every relative
import gained a level. Ours differed only by the ClickUp handler, which now
registers from '../clickup'.
@kristijan-koncar-gete

Copy link
Copy Markdown

How we can use it and integrate it?

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ClickUp as a task source

3 participants