Skip to content

fix(clickup-app): include folder-contained lists in get_all_lists (#13808) - #13844

Merged
kodjima33 merged 3 commits into
BasedHardware:mainfrom
Abhist17:fix/clickup-app-folder-lists
Sep 14, 2026
Merged

kodjima33 merged 3 commits into
BasedHardware:mainfrom
Abhist17:fix/clickup-app-folder-lists

Conversation

@Abhist17

@Abhist17 Abhist17 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Fixes #13808.

get_all_lists in plugins/omi-clickup-app/clickup_client.py walked each space with GET /space/{id}/list, which ClickUp API v2 limits to folderless lists. Every list organised inside a folder — the normal way a ClickUp workspace is laid out — was invisible to the plugin: the settings picker never offered it and task routing could not target it.

  • get_folders() reads GET /space/{id}/folder. ClickUp embeds each folder's lists in that response, so it is one call per space; get_folder_lists() (GET /folder/{id}/list) covers a folder that arrives without them.
  • get_all_lists() appends folder lists after the folderless ones, carrying folder_id and folder_name. name stays the bare list name because task_detector matches spoken list names against it (lst["name"].lower() == spoken_lower, three places) — nobody says "Sprint 1 / Bugs" out loud.
  • A failed folder request makes get_all_lists return [] rather than the folderless subset — the same discard-partial-results contract as the github-app fetchers (fix(github-app): page through repository labels #13546). A folderless-only answer after a failed folder request is the original bug, made intermittent.
  • The settings picker labels folder lists Folder / List (Space), since two folders routinely hold a list with the same name (every sprint has a "Bugs").
  • Second commit: the picker now escapes ClickUp-supplied names at the HTML boundary. It interpolated list and space names into <option> markup unescaped before, and this change adds folder names to the same string.

Not changed, deliberately: get_spaces/get_lists keep their pre-existing return-[]-on-error behaviour, and /refresh-lists still reports success: True, lists_count: 0 after a failed fetch (pre-existing for every failure, now visible instead of silent for folders). Happy to tighten either in a follow-up. task_detector's list_map keyed on bare name also means two lists with the same name in different folders resolve to whichever came last — a pre-existing limitation that folder lists make more likely to hit; flagging rather than widening this PR.

Product invariants affected

none

How it was verified

  • Drove the real app end-to-end against a fake ClickUp v2 server on localhost (STORAGE_DIR pointed at a scratch dir, clickup_client.base_url at the fake): POST /refresh-lists → real get_all_lists → real requests → real storage → GET /?uid=…. Result: {'success': True, 'lists_count': 5} — 1 folderless list plus 4 folder lists across two spaces, one via the non-embedded /folder/{id}/list fallback. The picker rendered Inbox (Engineering), Sprint 1 / Bugs (Engineering), Sprint 1 / Features (Engineering), &lt;b&gt;Sprint 2&lt;/b&gt; / Bugs (Engineering), Campaigns / Q4 Launch (Marketing). With the folder endpoint returning 500 the log reads ❌ Error getting folder lists for space s1: Error getting folders: 500 - … and the result is lists_count: 0, not a silent folderless subset.
  • make preflight: 15 checks pass, including both new manifest entries.
  • Could not exercise a live ClickUp workspace (needs an OAuth app deployment); the response shapes in the tests and the fake server are ClickUp API v2's documented ones (/space/{id}/list embeds a folder object per list; /space/{id}/folder embeds lists per folder).

Tests

  • plugins/omi-clickup-app/test_clickup_client.py (new, registered as clickup-app-client-tests): drives get_all_lists through a patched requests seam — embedded folder lists, the per-folder fallback, a 500 on either folder endpoint failing closed to [], and a space with no folders keeping its folderless lists. Four of the five fail on the old client (only Inbox comes back).
  • plugins/omi-clickup-app/test_settings_page.py (new, registered as clickup-app-settings-page-tests): renders the real root handler with a stubbed framework — folder label, and a folder named <b>Sprint</b> in a space named Eng & Co coming out as text. Both fail on the old main.py.
  • Module-level requests/dotenv/framework imports are stubbed inside a patch.dict(sys.modules, …) scope like the sibling plugin suites, so nothing leaks into a shared test process and the files run on a stdlib-only interpreter.

Failure class (fixes)

Failure-Class: none

Review in cubic

get_all_lists walked each space with GET /space/{id}/list, which ClickUp
API v2 limits to folderless lists. Every list organised inside a folder —
the normal way a ClickUp workspace is laid out — was invisible: the
settings picker never offered it and task routing could not target it.

- get_folders() reads GET /space/{id}/folder; ClickUp embeds each
  folder's lists in that response, so it is one call per space.
  get_folder_lists() (GET /folder/{id}/list) covers a folder that
  arrives without them.
- get_all_lists() appends folder lists after the folderless ones. They
  carry folder_id and folder_name; `name` stays the bare list name
  because task_detector matches spoken list names against it, and
  nobody says "Sprint 1 / Bugs" out loud.
- A failed folder request makes get_all_lists return [] rather than the
  folderless subset — the same discard-partial-results contract as the
  github-app fetchers. A folderless-only answer after a failed folder
  request is the original bug, made intermittent.
- The settings picker labels folder lists "Folder / List (Space)", since
  two folders routinely hold a list with the same name.

Tests: test_clickup_client.py drives get_all_lists through a patched
requests seam with ClickUp v2-shaped responses — embedded folder lists,
the per-folder fallback, a 500 on either folder endpoint failing closed
to [], and a space with no folders keeping its folderless lists. Four of
the five fail on the old client (only "Inbox" comes back).
test_settings_page.py drives the real root handler with a stubbed
framework and asserts the folder label. Both suites are registered in
.github/checks-manifest.yaml (local + ci) and pass through `make
preflight` (15 checks).

Failure-Class: none
The list picker interpolated list and space names straight into
<option> markup. Names are user-controlled on the ClickUp side, and the
previous commit adds folder names to the same string, so a folder called
<b>x</b> would have rendered as markup. Escape at the HTML boundary.

Tests: test_settings_page.py renders the real root handler with a folder
named <b>Sprint</b> and a space named "Eng & Co" and asserts both come
out as text.

@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.

All reported issues were addressed across 5 files

You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

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

Re-trigger cubic

… test

Review feedback on BasedHardware#13844: the escaping test only carried markup in the
folder and space names, so a regression that stopped escaping the list
name would have passed. The list is now named <script>Bugs</script> and
the whole rendered <option> is asserted.
Abhist17 added a commit to Abhist17/omi that referenced this pull request Sep 14, 2026
… test

Review feedback on BasedHardware#13844: the escaping test only carried markup in the
folder and space names, so a regression that stopped escaping the list
name would have passed. The list is now named <script>Bugs</script> and
the whole rendered <option> is asserted.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VAU5PGH57hXyipiE3zhNZk
@Abhist17
Abhist17 force-pushed the fix/clickup-app-folder-lists branch from 5cc73d9 to a6f66a8 Compare September 14, 2026 14:09

@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.

Community/plugins bug fix, confidence 5/5: fixes #13808, includes a stored-XSS fix (HTML escaping) that the sibling PR #13809 lacks, real end-to-end test against a fake ClickUp server, cubic review clean. Best of 3 duplicate submissions for #13808.

@Abhist17

Copy link
Copy Markdown
Contributor Author

Following up on payment for this one — merged 2026-09-14.

I've emailed [email protected] with the full list of my merged bounty PRs, as the contribution guide asks under Paid Bounties ("claiming payment"). Leaving a note here too so it's on the thread rather than only in a mailbox.

This one was proposed by another contributor (#13808) and mine was the PR that merged, so the amount is entirely at your discretion.
cc @kodjima33 @josancamon19

Payout — crypto is easiest for me, USDC/USDT on either chain:

  • EVM (Ethereum / Base / Polygon / Arbitrum): 0x49A441f63f00b1978Aa4DD4ff52C237a4A7FdF82
  • Solana: FQetSNNrMouXQ1W3hzCunkd3V5kyvvBtKxQZ2mWfksxV

Happy to use whatever method is simplest on your side. Thanks!

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.

[Bounty proposal] fix(clickup-app): folder-contained lists invisible in get_all_lists

2 participants