Skip to content

fix(plugins): include ClickUp folder-contained lists - #13288

Closed
kaijakagi-sys wants to merge 6 commits into
BasedHardware:mainfrom
kaijakagi-sys:fix/clickup-folder-lists-13130
Closed

kaijakagi-sys wants to merge 6 commits into
BasedHardware:mainfrom
kaijakagi-sys:fix/clickup-folder-lists-13130

Conversation

@kaijakagi-sys

@kaijakagi-sys kaijakagi-sys commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #13130. Include folder-contained ClickUp lists alongside folderless lists in the shared discovery client used by OAuth setup and refresh. Retain list IDs, folder IDs and space metadata. Each folder is fetched independently so one failed folder request does not hide successfully retrieved lists.

Provider contracts: folderless lists, folders in a space, and lists within a folder. Fetch each folder's list endpoint rather than relying on embedded list summaries.

Verification

  • Production client at e0308b66dd699bed67dc59be1f1e47237c81f387: new offline regression fails in four cases before the fix.

  • python3 plugins/omi-clickup-app/test_clickup_client.py: five methods / six cases pass after the fix; folder-only, mixed spaces, empty folder/workspace and HTTP/transport failures covered.

  • Regression executes the complete production client with HTTP and dotenv doubles; no real credentials, network or provider service.

  • Registered in both local and CI checks-manifest lanes and documented in plugin README. This component-specific behavioral suite guards incident ClickUp integration list selection omits lists inside folders #13130, not a replacement source-string or shared-policy checker.

  • OAuth setup/refresh call sites were inspected; browser, live OAuth, real ClickUp, routing and storage integration have not been run.

  • make preflight: 14 checks pass (28.09s). scripts/pr-preflight --lane local --pr-body-file ../pr-body.md: 14 checks pass (27.56s). Failure-class validation and git diff --check pass.

  • History-dependent ratchets skip in this shallow checkout.

  • Backend Hermetic Merge Gate: out of scope for this standalone plugin fix and test registration; backend runtime setup/harness not run locally.

Failure-Class: none

Product invariants affected

none

Reward status

Suggested bounty scope in #13130 remains unconfirmed; no amount has been approved. Merge and discretionary maintainer eligibility are required.

Review in cubic

Fixes BasedHardware#13130. Four regression failures before; five methods/six cases pass after. Complete production client with HTTP/dotenv doubles; no live ClickUp/OAuth/UI. Local and draft-body preflight: 14 checks pass each.

Failure-Class: none

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 4 files

Confidence score: 4/5

  • In plugins/omi-clickup-app/clickup_client.py, get_all_lists() performs sequential HTTP requests for each folder and space during every OAuth setup and token-refresh path, which could increase setup latency and expose large workspaces to rate limiting; reduce, batch, or cache these requests where possible.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/omi-clickup-app/clickup_client.py">

<violation number="1" location="plugins/omi-clickup-app/clickup_client.py:219">
P3: get_all_lists() now issues one sequential HTTP request per folder (plus one per space) and is invoked on every OAuth setup and token-refresh/refresh path (main.py lines 557 and 701). For a workspace with many folders this grows to dozens of sequential round-trips, which can be slow in the refresh flow that runs in the background/setup. Lists and folders endpoints return the full non-archived set (no pagination), so the only way to keep isolation is per-folder requests; consider fetching folder calls in parallel (e.g., concurrent requests) or documenting the per-workspace request budget if scale is a concern.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

for space in spaces:
lists = self.get_lists(access_token, space["id"])
for folder in self.get_folders(access_token, space["id"]):
lists.extend(self.get_folder_lists(access_token, space["id"], folder["id"]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: get_all_lists() now issues one sequential HTTP request per folder (plus one per space) and is invoked on every OAuth setup and token-refresh/refresh path (main.py lines 557 and 701). For a workspace with many folders this grows to dozens of sequential round-trips, which can be slow in the refresh flow that runs in the background/setup. Lists and folders endpoints return the full non-archived set (no pagination), so the only way to keep isolation is per-folder requests; consider fetching folder calls in parallel (e.g., concurrent requests) or documenting the per-workspace request budget if scale is a concern.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/omi-clickup-app/clickup_client.py, line 219:

<comment>get_all_lists() now issues one sequential HTTP request per folder (plus one per space) and is invoked on every OAuth setup and token-refresh/refresh path (main.py lines 557 and 701). For a workspace with many folders this grows to dozens of sequential round-trips, which can be slow in the refresh flow that runs in the background/setup. Lists and folders endpoints return the full non-archived set (no pagination), so the only way to keep isolation is per-folder requests; consider fetching folder calls in parallel (e.g., concurrent requests) or documenting the per-workspace request budget if scale is a concern.</comment>

<file context>
@@ -181,6 +215,8 @@ def get_all_lists(self, access_token: str, team_id: str) -> List[Dict]:
         for space in spaces:
             lists = self.get_lists(access_token, space["id"])
+            for folder in self.get_folders(access_token, space["id"]):
+                lists.extend(self.get_folder_lists(access_token, space["id"], folder["id"]))
             for lst in lists:
                 lst["space_name"] = space["name"]
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks — the sequential request-volume concern is valid. I took the suggested documentation option in this PR and added a List-discovery request budget section to the plugin README, without changing runtime behavior.

At the reviewed head (99df84bd), get_all_lists makes 1 + 2S + F requests when enumeration succeeds: one space lookup, two requests per returned space (folderless lists + folders), and one list request per returned folder, including empty folders (clickup_client.py:108–225). This excludes workspace/member lookups and OAuth token/user requests. A one-off offline fixture using the existing production-client HTTP seam measured 121 calls for 10 spaces/100 folders; failing the first space's folder enumeration reduced that to 111 calls and omitted its 10 folder lists. These are request counts, not production latency measurements.

One caller clarification: main.py:557 is the OAuth callback; main.py:701 is the user-triggered POST /refresh-lists route (button at line 282, fetch at 404), not a background token-refresh job. The docs now identify these callers, sequential latency/rate-limit exposure, no retry/backoff or explicit HTTP timeout, and partial results when enumeration/list requests fail. No latency bound or performance improvement is claimed.

Verification: existing offline regression passed (5 methods / 6 cases), make preflight and explicit PR-body preflight passed, and git diff --check passed. Real OAuth/ClickUp service behavior remains unexercised; this follow-up changes documentation only.

Clarify OAuth setup and manual refresh callers, sequential 1 + 2S + F
request count, partial results, and lack of a client timeout bound.
No runtime behavior change.

Verification: existing offline regression passes (5 methods / 6 cases).
Production-client fixture measures 121 calls for 10 spaces / 100 folders,
or 111 with one failed folder enumeration. No latency benchmark claimed.
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified this fix end to end at the current head — solid work, and thank you for the thorough README request-budget section responding to the earlier review feedback.

What I checked:

  • plugins/omi-clickup-app/clickup_client.py — get_folders() (GET /space/{id}/folder) and get_folder_lists() (GET /folder/{id}/list) match ClickUp's documented contract, use the same archived=false filtering and error-handling style as the existing getters, and each folder fetch is independently guarded, so one failed folder request cannot hide successfully discovered lists. get_all_lists() interleaves folder-contained lists with folderless ones and keeps space_name stamping unchanged; the "Get folderless lists" docstring correction is right.
  • Consumers — main.py's settings dropdown, OAuth callback, and refresh-lists path, plus task_detector.py's name→id mapping, only read id/name/space_name, so the added folder_id/space_id keys are backward compatible. Folderless-only workspaces keep their exact prior behavior.
  • plugins/omi-clickup-app/test_clickup_client.py — ran the suite offline (fixture HTTP/dotenv doubles, no credentials, no network): 5/5 pass, including the failed-folder and folder-enumeration-failure cases. The asserted call order matches the documented 1 + 2S + F budget.
  • .github/checks-manifest.yaml — the clickup-list-discovery-tests entry follows the existing check schema and registers both local and CI lanes; the manifest parses cleanly with the new entry.
  • plugins/omi-clickup-app/README.md — the request-budget math checks out against the code (one space lookup, two requests per space, one per folder including empty ones), and the failure-semantics paragraph matches the per-folder try/except behavior. Good honest note that discovery remains sequential with no retry/timeout.

One non-blocking follow-up worth considering: lists with identical names in different folders of the same space render identically in the settings dropdown ("Name (Space)") and collide in task_detector.py's name→id map ({lst["name"]: lst["id"]}, last entry wins). That ambiguity predates this PR, but surfacing folder-contained lists makes it easier to hit — a folder qualifier in the display name would resolve it if it comes up in practice.

Leaving for human maintainer review: first contribution touching the ClickUp OAuth/refresh discovery path, and no CI summary is available for this head yet. The code itself looks correct and is well tested.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

backend/community fix: confirmed get_all_lists (docstring 'get all lists') only queried folderless lists, silently omitting any ClickUp list organized inside a folder. Fix adds folder + folder-list traversal. Issue #13130 real, tests added.

Preserve ClickUp and upstream USGS regression checks. Plugin code unchanged.
ClickUp and USGS: 5 tests each pass. Exact-base local preflight: 14 checks pass.
No live provider, OAuth or deployment verification.
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified from the plugin side — thank you for the clean fix and the thorough description.

Per-file notes:

  • plugins/omi-clickup-app/clickup_client.py — get_folders() and get_folder_lists() mirror the existing get_lists() error handling (log and return [] per folder), so one failed folder request no longer hides the other discovered lists. Folder-contained entries carry id/name/space_id/folder_id, same shape as the folderless ones, and the get_lists() docstring now correctly says "folderless".
  • plugins/omi-clickup-app/main.py consumers (unchanged, inspected): both /auth/callback and POST /refresh-lists store get_all_lists() output, and the settings page reads only id/name/space_name — all present on the new entries — so no downstream change was needed. Correct call keeping this contained to the client.
  • plugins/omi-clickup-app/test_clickup_client.py — ran the suite offline: 5 tests / 6 cases pass. It executes the real production client with requests.get and dotenv stubbed, and covers folder-only, mixed multi-space, empty folder/workspace, plus both HTTP-503 and transport-failure folders. Good failure-injection design.
  • .github/checks-manifest.yaml — clickup-list-discovery-tests follows the existing plugin-test entries (local+ci lanes, path triggers including the manifest itself).
  • plugins/omi-clickup-app/README.md — the 1 + 2S + F request budget matches the code path exactly, and the call-site claims (discovery during OAuth setup and manual Refresh Lists, no background refresh, no client-side timeout/retry) check out against main.py. Documenting those pre-existing limitations alongside the fix is helpful.

Nothing blocking found. Nice first contribution.

This review was posted by automation on David's behalf; AI-generated feedback.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added the positive-signal Automation verified a genuine fix/quality contribution label Sep 10, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up since the earlier review on this head: the fix itself still verifies cleanly (0789b5a2 is unchanged, offline suite 5/5 here), but main has moved and this branch now has one small merge conflict to clear before it can land.

What happened: #13391 added an omi-hacker-news-tests entry to .github/checks-manifest.yaml at the same spot where this PR inserts clickup-list-discovery-tests (top of the checks: list), so the two additions now collide textually. I test-merged current main against this head: .github/checks-manifest.yaml is the only conflicted file — everything under plugins/omi-clickup-app/ merges cleanly.

Suggested resolution: merge main in again (or rebase) and keep both entries — clickup-list-discovery-tests and omi-hacker-news-tests side by side. Nothing else needs to change; the earlier assessment stands.

This review was posted by automation on David's behalf; AI-generated feedback.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

Resolve checks-manifest conflict by retaining both ClickUp list discovery and Hacker News checks. Preserve the existing plugin change.

Validation: five ClickUp tests, three Hacker News tests, and 14 local preflight checks pass. The full-history ratchet is skipped in the shallow checkout.

Failure-Class: none
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for merging main back in — that clears the last blocker the earlier automated review flagged. Checked the new head (4f67cc2e) end to end:

  • .github/checks-manifest.yaml — the collision with omi-hacker-news-tests (fix(plugins): preserve escaped angle-bracket text in Hacker News discussions #13391) is resolved; both entries now sit side by side and clickup-list-discovery-tests keeps its local and ci lanes. That was the only conflicted file, as expected.
  • plugins/omi-clickup-app/clickup_client.py, test_clickup_client.py, and README.md — unchanged by the merge (identical to the commit human-reviewed on Sep 9). Re-ran python3 plugins/omi-clickup-app/test_clickup_client.py at this head: 5 tests / 6 cases pass offline, including the transport-failure and 503 folder-enumeration paths. The README's 1 + 2S + F request-budget section still matches get_all_lists()'s actual traversal.

About the red "Dart Analyze & Tests" check: it is not caused by this PR. The errors are analyzer mismatches in app/test/providers/deletion_consistency_test.dart and app/test/widgets/chat_content_blocks_test.dart against the ActionItemsFetcher typedef, which #13570 widened on main yesterday (dueStartDate/dueEndDate named parameters). This PR's diff touches no Dart, and main's own mobile-app-checks runs path-skip the Dart job, so the breakage only becomes visible on full-lane runs like this one. It needs a main-side fix in those two test files; no need to hold this PR waiting on that check turning green.

With the conflict cleared, GitHub reports the branch mergeable and the earlier human review of the plugin logic still applies, since the merge commits didn't touch these plugin files.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

… for BasedHardware#13288

Preserve the reviewed plugin files unchanged. Component regression tests, make preflight and explicit PR-body preflight pass locally; hosted mobile and Swift CI remain authoritative.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-verified after new commits: ClickUp folder-contained list discovery fix is real, scoped, tested, not yet on main. CI green. DIRTY/conflicting mergeability — leaving at approve, not merging.

Copy link
Copy Markdown
Contributor Author

The checks-manifest conflict noted in your review is resolved in dad701e91322fbd6042be9be2d7c26505587d1f0, which merges main at 10748b0. The resolution preserves upstream manifest entries and this PR's regression registration; the plugin source is unchanged. The 5 targeted tests and both required local preflight commands passed on the repaired tree.

GitHub now reports this head mergeable. Eight of nine hosted workflows have passed; Desktop Swift CI is still queued, so the new head is not fully CI-green yet. The conflict blocker is cleared; once that remaining check finishes, this is ready for your merge decision.

Copy link
Copy Markdown
Contributor Author

The remaining Desktop Swift CI run has now succeeded on dad701e91322fbd6042be9be2d7c26505587d1f0. I checked the actual jobs: desktop Swift app tests, launcher script tests, release compile and the independent phase verdicts passed. All nine returned workflows now report success; macOS-scoped manifest checks and the release-mode UserNotifications regression were skipped, so this is not a claim that every check executed.

This closes the pending-CI caveat in my conflict-resolution update. GitHub still reports the repaired head mergeable. Could a maintainer make the merge decision for the retained folder-contained list discovery fix, or identify any remaining requirement?

@Git-on-my-level

Copy link
Copy Markdown
Member

Independently verified on the current head (dad701e):

  • plugins/omi-clickup-app/clickup_client.py — get_folders and get_folder_lists follow the existing client style (print + return [] on failure), and get_all_lists now folds folder-contained lists in per space, with each folder fetched independently so one failed folder request can't hide successfully discovered lists. Consumers in main.py (OAuth setup and POST /refresh-lists, plus the settings dropdown that reads only id/name/space_name) are shape-compatible with the added folder_id field.
  • plugins/omi-clickup-app/test_clickup_client.py — ran the suite locally against the production client: 5 tests / 6 cases pass. It executes the real module with requests/dotenv doubles (no network, no credentials) and asserts exact call sequences and list shapes, which is the behavioral-through-a-seam coverage the repo's bug-fix rule asks for.
  • .github/checks-manifest.yaml — clickup-list-discovery-tests is registered in both local and ci lanes with sensible triggers, and the head merge kept the neighboring plugin checks intact.
  • plugins/omi-clickup-app/README.md — the documented 1 + 2S + F request budget checks out against the code (10 spaces / 100 folders → 121 requests), including the honest caveats about sequential fetching, no retry/backoff/timeout, and partial results after failed enumeration.

Note for the merge trail: the latest approval sits on fd0de23; the current head dad701e is a main merge that changes no omi-clickup-app files (manifest conflict resolution only), so that approval still describes the reviewed plugin code. One pre-existing limitation worth a follow-up issue rather than this PR: discovery has no HTTP timeout, so a hung request during OAuth setup or Refresh Lists can stall indefinitely — the README already documents this.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified on dad701e91322.

Head is CONFLICTING/DIRTY, so this cannot merge even with kodjima APPROVE. Rebase onto current main and keep the diff on .github/checks-manifest.yaml, plugins/omi-clickup-app/README.md, plugins/omi-clickup-app/clickup_client.py, plugins/omi-clickup-app/test_clickup_client.py.

kodjima size-gate APPROVE is not a maintainer merge. I am not merging until this is MERGEABLE and green.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing because this is already on main (ClickUp folder-contained lists are already walked). The keep is #13844. This head does not add a unique production file.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @kaijakagi-sys 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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

Labels

positive-signal Automation verified a genuine fix/quality contribution python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClickUp integration list selection omits lists inside folders

4 participants