Repository navigation
fix(hive-app): search_tasks scans every project, not just the 50 most recent workspace actions - #15297
Conversation
… recent workspace actions
search_tasks fetched a single workspaces/{id}/actions?limit=50 -- a cap on
the 50 most recently touched actions across the whole workspace, not per
project. A task outside that window was silently unfindable by exact name
no matter how small its own project was, breaking
tool_hive_update_task_status's name lookup and tool_hive_create_task's
parent-task lookup on any workspace with more than 50 actions in flight,
even though the caller only ever asked about one specific, existing task.
Now scans per project via the same projectId-scoped request
get_project_tasks already uses, raising the effective ceiling to 50 per
project. Capped at 20 projects per search and stops early once there are
enough exact matches to be definitive, so a workspace with an unusual
number of projects still bounds the request count.
Updated the existing update-task-status tests' mocks for the extra
projects-list call this adds, and added a dedicated regression suite
(test_search_tasks_multi_project.py) proving a match that only exists in
a workspace's second project is now found, one project's error doesn't
lose matches from the others, and ambiguous partial matches across
projects are all surfaced.
|
Verified the fix end to end in a clean checkout of this branch — nice work, and thank you for the thorough PR description. What I checked:
Two non-blocking observations for the record:
Since this is a first contribution, formal approval stays with a human maintainer; the change itself raises no product or architecture questions. 🤖 Automated review on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Not approving this SHA. The production diff is +408/−193, and Not merging. |
…on text to users Addresses @aryanorastar's review on this PR: 1. The prior push ran the pinned formatter across the whole file, which reformatted ~240 unrelated lines (spacing, docstring blank lines) that had nothing to do with this change. Reverted main.py to the untouched original and reapplied only the actual search_tasks edit by hand, matching the file's existing style instead of a blanket reformat -- the pristine original also fails the formatter's --check today, which is pre-existing repo debt this PR shouldn't carry. main.py's diff is now 118 lines instead of 338. 2. hive_get_projects/hive_get_tasks/hive_create_task/hive_search/ hive_update_task_status all returned f"...: {str(e)}" straight to the chat tool response on any unhandled exception. Now log the real exception server-side and return a fixed, generic message instead, matching the safe-logging pattern hive_rest_request's own except block already uses one function up (type(e).__name__, never the raw message -- this file already has FC-secret-printed-to-plugin-logs precedent elsewhere in the repo for exactly this class of leak). New regression test proving no exception detail reaches the user-facing error.
|
Thanks for the review — both addressed:
Pushed as |
kodjima33
left a comment
There was a problem hiding this comment.
search_tasks in the Hive integration plugin now scans every project in the workspace (bounded at 20, same projectId-scoped request get_project_tasks already uses) instead of a single workspace-wide 50-action cap, fixing silent 'task not found' failures for update_task_status and create_task's parent-task lookup on workspaces with >50 recently-touched actions (Fixes #15296). Also fixes 5 spots leaking raw exception text (str(e)) into user-facing chat tool errors, now logged server-side and returned as a fixed generic message. New tests cover multi-project exact/partial matches, per-project error isolation, and the error-leak fix; registered in checks-manifest.yaml and verified passing. Full plugin suite 39/39, CI green. Confidence 5/5.
|
Following up on payment for this one — merged 2026-09-21. 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. Bounty: $50 — proposal #15296. Payout — crypto is easiest for me, USDC/USDT on either chain:
Happy to use whatever method is simplest on your side. Thanks! |
Description
search_tasksinplugins/omi-hive-app/main.pyfetches a singleworkspaces/{id}/actions?limit=50and filters locally for a name match — a cap on the 50 most recently touched actions across the entire workspace, not per project. A task outside that window is silently unfindable by exact name no matter how small its own project is.This breaks two real user flows, both of which only ever ask about one specific, existing task:
tool_hive_update_task_status's name lookup — "mark 'Fix login bug' as done" returns "task not found" if that task isn't among the workspace's 50 most recently touched actions.tool_hive_create_task's parent-task lookup (parent_task_name) — same failure mode when attaching a sub-task to an existing parent.The fix
search_tasksnow scans every project in the workspace, via the sameprojectId-scoped requestget_project_tasksalready uses successfully elsewhere in this file — raising the effective ceiling from "50 most recent actions in the whole workspace" to "50 per project." Bounded at 20 projects per search, and stops early once there are enough exact matches to be definitive, so a workspace with an unusual number of projects still bounds the request count. A single project erroring doesn't lose matches from the others.Review feedback addressed (from @aryanorastar)
main.pyto the untouched original and reapplied only the actual edit by hand, matching the file's existing style instead of a blanket reformat (the pristine original also failsscripts/backend-python-format --checktoday — pre-existing repo debt, not something this PR should carry).main.py's diff is now 118 lines instead of 338.str(e)interpolated into user-visible tool errors — all 5 named spots (hive_get_projects,hive_get_tasks,hive_create_task,hive_search,hive_update_task_status) now log the real exception server-side (print(f"🐝 Hive <op> error: {type(e).__name__}: {e}"), matching this file's existing diagnostic-print convention) and return a fixed, generic message to the chat tool response instead.Testing performed
test_search_tasks_multi_project.py: an exact match that only exists in a workspace's second project is found; one project's error doesn't lose matches from another; ambiguous partial matches spread across projects are all surfaced; no workspace means no request at all.test_an_unhandled_exception_does_not_leak_into_the_user_facing_error: proves a raw exception message (host/IP in this test) never reaches the chat response.test_update_task_status.py's existing mocks for the extra projects-list call this adds (the tests' actual behavioral assertions — which match gets mutated, that ambiguous matches refuse to mutate anything — are unchanged; only the call-count/mock-shape mechanics needed to move)..github/checks-manifest.yaml(hive-search-tasks-multi-project-tests) — verified it's actually discovered and run:python3 .github/scripts/run_checks.py --check-id hive-search-tasks-multi-project-tests --lane local.python3 -m unittest discover -p "test_*.py"inplugins/omi-hive-app/— 39/39 passing.python3 .github/scripts/run_checks.py --lane local --base origin/main— all selected checks pass.scripts/backend-python-format --checkon the lines this PR actually touches — clean; not run against the whole file for the reason above.Type of Change
Product invariants affected
none
Failure class (fixes)
Failure-Class: none
No existing class matches this shape (a text-search helper scoped to a subset of a workspace's records rather than the requested single record). Happy to have a maintainer fold it into a broader "search operation returns an incomplete result set silently" class if one gets declared — this is at least the third instance of that general shape found across the integration plugins tonight (Notion's
get_pageblock pagination, already fixed via #14079; Dropbox's folder-listing pagination, proposed separately in #15153).Fixes #15296