Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(tasks): add staff filter to see all team tasks (#70775)

Georgiy Tarasovfe980c3020e5
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index d243b9d3bd7a..0f40ac7e5c38 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2531,7 +2531,7 @@ snapshots:
filters-taxonomic-filter-menu-rebuild--data-warehouse-config--dark:
hash: v1.k794b7964.75a7dc4221b22571369d6b3a1253e2f91d5caddccf58d022c4f0c3e5764bed33.ozhnlesjhew_maunSC-4TAGhNFiLtWf_QnkDQnpiVaY
filters-taxonomic-filter-menu-rebuild--data-warehouse-config--light:
- hash: v1.k794b7964.f0c78d3a90f0431ab68537348546d56b8effc1eddcef1daef30bf63eb42876a4.21-RouUOREp2fB1dEhxhFLxMahAqWrf61vxp4I-tSlo
+ hash: v1.k794b7964.48d96bddd32a3aab5e42c6b74c8404452559526a6a7f50931e037ce2d19b95b2.2K6X_AFjB8Yjo5SjwZvHlU0La7Kp79G-BSqYjMUoB9Q
filters-taxonomic-filter-menu-rebuild--events-and-actions--dark:
hash: v1.k794b7964.d5355b3d3319f4838b0295159ce6c76348860d868e010f2fdbb3c99a5700ebfd.vVOuWbc1CpuiQPBuqg7oTse3PJCTw6PctXuNB634_58
filters-taxonomic-filter-menu-rebuild--events-and-actions--light:
diff --git a/products/posthog_ai/frontend/logics/tasksLogic.ts b/products/posthog_ai/frontend/logics/tasksLogic.ts
index 4efc40f90f62..7e069a4080ab 100644
--- a/products/posthog_ai/frontend/logics/tasksLogic.ts
+++ b/products/posthog_ai/frontend/logics/tasksLogic.ts
@@ -139,16 +139,25 @@ export const tasksLogic = kea<tasksLogicType>([
}),
selectors({
+ // The "all team" filter is staff-only; expose it so the menu can conditionally show it.
+ isStaffUser: [(s) => [s.user], (user): boolean => !!user?.is_staff],
// Combined list filters: search term + the assignee toggle. "For you" scopes to the current
- // user's own tasks; "team scouts" scopes to autonomous Signals Scout tasks.
+ // user's own tasks; "team scouts" scopes to autonomous Signals Scout tasks; "all team" (staff
+ // only) lists every task on the team, letting the server bypass the per-user visibility filter.
taskListParams: [
(s) => [s.searchQuery, s.assigneeFilter, s.user],
- (searchQuery, assigneeFilter, user): TaskListParams => ({
- search: searchQuery || undefined,
- ...(assigneeFilter === 'for_you'
- ? { created_by: user?.id }
- : { origin_product: OriginProduct.SIGNALS_SCOUT }),
- }),
+ (searchQuery, assigneeFilter, user): TaskListParams => {
+ const base: TaskListParams = { search: searchQuery || undefined }
+ // Guard here too: a non-staff user must never send `all_team_tasks` (the server ignores
+ // it, but this keeps the request honest and falls back to their own tasks).
+ if (assigneeFilter === 'all_team' && user?.is_staff) {
+ return { ...base, all_team_tasks: true }
+ }
+ if (assigneeFilter === 'team_scouts') {
+ return { ...base, origin_product: OriginProduct.SIGNALS_SCOUT }
+ }
+ return { ...base, created_by: user?.id }
+ },
],
}),
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskAssigneeFilterMenu.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskAssigneeFilterMenu.tsx
index 559695e6eab0..381bd3cbe249 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskAssigneeFilterMenu.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskAssigneeFilterMenu.tsx
@@ -15,7 +15,7 @@ import { tasksLogic } from '../../../logics/tasksLogic'
import { TaskAssigneeFilter } from '../../../types/taskTypes'
export function TaskAssigneeFilterMenu(): JSX.Element {
- const { assigneeFilter } = useValues(tasksLogic)
+ const { assigneeFilter, isStaffUser } = useValues(tasksLogic)
const { setAssigneeFilter } = useActions(tasksLogic)
return (
@@ -35,6 +35,9 @@ export function TaskAssigneeFilterMenu(): JSX.Element {
>
<DropdownMenuRadioItem value="for_you">For you</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="team_scouts">Team scouts</DropdownMenuRadioItem>
+ {isStaffUser && (
+ <DropdownMenuRadioItem value="all_team">All team tasks (staff)</DropdownMenuRadioItem>
+ )}
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx
index 6246a64d0194..1f50fbe71f18 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx
@@ -1,5 +1,7 @@
import { BindLogic, useActions, useValues } from 'kea'
+import { userLogic } from 'scenes/userLogic'
+
import { runInteractionLogic, type RunInteractionLogicProps } from 'products/posthog_ai/frontend/api/logics'
import { Composer, QueuedMessageList } from 'products/posthog_ai/frontend/api/primitives'
// Eager, NOT the lazy `api/readableRun` facade: the runner scene is already a route-split chunk and the run
@@ -34,7 +36,11 @@ export interface TaskRunChatProps {
*/
export function TaskRunChat({ taskId, runId, streamKey, onRunStarted }: TaskRunChatProps): JSX.Element {
const { setSelectedRunId, loadTaskRuns } = useActions(taskDetailSceneLogic({ taskId }))
- const { selectedRun } = useValues(taskDetailSceneLogic({ taskId }))
+ const { selectedRun, task } = useValues(taskDetailSceneLogic({ taskId }))
+ const { user } = useValues(userLogic)
+ // Staff can view tasks they don't own (support/debugging); those are read-only — hide the composer so
+ // they can't try to drive a run they can't control (the backend rejects the write anyway).
+ const readOnly = !!user?.is_staff && !!task?.created_by && task.created_by.id !== user.id
const logicProps: RunInteractionLogicProps = {
taskId,
runId,
@@ -52,12 +58,18 @@ export function TaskRunChat({ taskId, runId, streamKey, onRunStarted }: TaskRunC
return (
<BindLogic logic={runInteractionLogic} props={logicProps}>
- <TaskRunChatContent logicProps={logicProps} />
+ <TaskRunChatContent logicProps={logicProps} readOnly={readOnly} />
</BindLogic>
)
}
-function TaskRunChatContent({ logicProps }: { logicProps: RunInteractionLogicProps }): JSX.Element {
+function TaskRunChatContent({
+ logicProps,
+ readOnly,
+}: {
+ logicProps: RunInteractionLogicProps
+ readOnly: boolean
+}): JSX.Element {
return (
// `RunSurface.Root` and `runInteractionLogic` deliberately share the same stream key (`streamKey ?? runId`,
// resolved inside each): the composer slot's gating must read the exact stream the thread renders. The
@@ -70,12 +82,15 @@ function TaskRunChatContent({ logicProps }: { logicProps: RunInteractionLogicPro
>
<div className="@container/thread flex flex-col h-full -mx-4">
<RunSurface.Thread className="flex-1 min-h-0" listClassName="py-4" rowClassName="px-4" />
- <RunSurface.Composer>
- <RunSurface.Resources />
- {/* The composer owns the per-keystroke draft in an isolated child so typing never re-renders
- the thread/virtualizer rendered as its sibling above — that cascade is what made the input lag. */}
- <LiveComposer logicProps={logicProps} />
- </RunSurface.Composer>
+ {/* Stay live (stream keeps flowing) but omit the composer entirely for a read-only viewer. */}
+ {!readOnly && (
+ <RunSurface.Composer>
+ <RunSurface.Resources />
+ {/* The composer owns the per-keystroke draft in an isolated child so typing never re-renders
+ the thread/virtualizer rendered as its sibling above — that cascade is what made the input lag. */}
+ <LiveComposer logicProps={logicProps} />
+ </RunSurface.Composer>
+ )}
</div>
</RunSurface.Root>
)
diff --git a/products/posthog_ai/frontend/types/taskTypes.ts b/products/posthog_ai/frontend/types/taskTypes.ts
index 2e46b0896bf7..26ce38a7dde3 100644
--- a/products/posthog_ai/frontend/types/taskTypes.ts
+++ b/products/posthog_ai/frontend/types/taskTypes.ts
@@ -22,8 +22,11 @@ export enum OriginProduct {
POSTHOG_AI = 'posthog_ai',
}
-/** TaskTracker list filter: the current user's own tasks vs. team scout tasks. */
-export type TaskAssigneeFilter = 'for_you' | 'team_scouts'
+/**
+ * TaskTracker list filter: the current user's own tasks, team scout tasks, or — staff only —
+ * every task on the team.
+ */
+export type TaskAssigneeFilter = 'for_you' | 'team_scouts' | 'all_team'
export enum TaskRunStatus {
NOT_STARTED = 'not_started',
@@ -107,6 +110,8 @@ export interface TaskListParams {
internal?: 'true' | 'false' | 'all'
search?: string
status?: TaskRunStatus
+ /** Staff-only. List every task on the team, bypassing the per-user visibility filter. Ignored server-side for non-staff. */
+ all_team_tasks?: boolean
/** Page size (LimitOffset pagination); the viewset caps it at 100. */
limit?: number
offset?: number
diff --git a/products/tasks/backend/facade/api.py b/products/tasks/backend/facade/api.py
index 65aedcd3b2e4..d5c94e1d4bb4 100644
--- a/products/tasks/backend/facade/api.py
+++ b/products/tasks/backend/facade/api.py
@@ -3243,9 +3243,11 @@ async def select_repository_for_message(team_id: int, user_id: int, message: str
)
-def _list_tasks_queryset(team_id: int, user_id: int | None, *, filters: dict) -> QuerySet[Task]:
+def _list_tasks_queryset(
+ team_id: int, user_id: int | None, *, filters: dict, bypass_visibility: bool = False
+) -> QuerySet[Task]:
latest_run = TaskRun.objects.filter(task=OuterRef("pk"), team_id=team_id).order_by("-created_at", "-id")
- qs = _visible_task_qs(team_id, user_id).order_by("-created_at", "-id")
+ qs = _visible_task_qs(team_id, user_id, bypass_visibility=bypass_visibility).order_by("-created_at", "-id")
origin_product = filters.get("origin_product")
if origin_product:
diff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.py
index 709fd9e331fe..c4e97bbefee6 100644
--- a/products/tasks/backend/presentation/serializers.py
+++ b/products/tasks/backend/presentation/serializers.py
@@ -1247,6 +1247,14 @@ class TaskListQuerySerializer(serializers.Serializer):
),
)
channel = serializers.UUIDField(required=False, help_text="Filter tasks to a channel's feed.")
+ all_team_tasks = serializers.BooleanField(
+ required=False,
+ default=False,
+ help_text=(
+ "Staff-only. When true, list every task on the team regardless of creator or channel, "
+ "bypassing the per-user visibility filter. Ignored for non-staff users."
+ ),
+ )
class ChannelSerializer(DataclassSerializer):
diff --git a/products/tasks/backend/presentation/views/api.py b/products/tasks/backend/presentation/views/api.py
index 04d09856f6b2..92237adb81ac 100644
--- a/products/tasks/backend/presentation/views/api.py
+++ b/products/tasks/backend/presentation/views/api.py
@@ -150,6 +150,19 @@ def _is_internal_debug_team(team_id: int | None) -> bool:
return team_id == 2 and settings.CLOUD_DEPLOYMENT == "US"
+def _can_bypass_visibility(request, team_id: int | None) -> bool:
+ """Whether this request may READ tasks/runs it doesn't own (never write — control stays creator-scoped).
+
+ - Staff users: unconditionally, on any team (support/debugging). No opt-in needed, so staff don't hit
+ the per-creator 404 when opening a task by URL or streaming its run logs — the frontend can't reliably
+ thread a query param through every read (the SSE stream doesn't carry one).
+ - Internal-debug teams: keep the narrower, explicit ``?ph_debug=true`` opt-in (dev/debug workflow).
+ """
+ if bool(getattr(request.user, "is_staff", False)):
+ return True
+ return _is_internal_debug_team(team_id) and request.query_params.get("ph_debug") == "true"
+
+
class _SchemaAwareLimitOffsetPagination(LimitOffsetPagination):
"""LimitOffsetPagination subclass that surfaces `default_limit`/`max_limit` in the OpenAPI schema."""
@@ -235,7 +248,13 @@ class TaskViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
filters["internal"] = getattr(request, "validated_query_data", {}).get("internal")
filters["archived"] = getattr(request, "validated_query_data", {}).get("archived")
filters["channel"] = getattr(request, "validated_query_data", {}).get("channel")
- tasks = tasks_facade._list_tasks_queryset(self.team_id, self._user_id(), filters=filters)
+ # Staff can opt into seeing every team task; re-check server-side so a client can't
+ # forge the flag to bypass the per-user visibility gate.
+ all_team_tasks = bool(getattr(request, "validated_query_data", {}).get("all_team_tasks"))
+ bypass_visibility = all_team_tasks and _can_bypass_visibility(request, self.team_id)
+ tasks = tasks_facade._list_tasks_queryset(
+ self.team_id, self._user_id(), filters=filters, bypass_visibility=bypass_visibility
+ )
page = self.paginate_queryset(tasks)
assert page is not None, "TaskViewSet list requires an active paginator"
return self.get_paginated_response(
@@ -248,7 +267,7 @@ class TaskViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
description="Retrieve a single task by ID.",
)
def retrieve(self, request, pk=None, **kwargs):
- bypass_visibility = _is_internal_debug_team(self.team_id) and request.query_params.get("ph_debug") == "true"
+ bypass_visibility = _can_bypass_visibility(request, self.team_id)
task = tasks_facade.get_task_detail(pk, self.team_id, self._user_id(), bypass_visibility=bypass_visibility)
if task is None:
raise NotFound()
@@ -793,29 +812,17 @@ class TaskRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
def _ensure_task_accessible(self) -> str:
"""Gate access to the parent task, mirroring the old ``safely_get_queryset``.
- ``?ph_debug=true`` lets internal-debug teams read other members' runs through read-only
- actions.
+ Staff users (and internal-debug teams via ``?ph_debug=true``) may read another member's runs
+ through the read-only actions; the bypass never applies to control actions.
"""
task_id = self._task_id()
is_read_only = self.action in self._READ_ONLY_ACTIONS
- is_internal_debug_read = (
- _is_internal_debug_team(self.team_id)
- and self.action
- in (
- "list",
- "retrieve",
- "logs",
- "session_logs",
- "stream",
- "stream_token",
- )
- and self.request.query_params.get("ph_debug") == "true"
- )
+ bypass_visibility = is_read_only and _can_bypass_visibility(self.request, self.team_id)
if not tasks_facade.task_accessible_for_run_view(
task_id,
self.team_id,
self._user_id(),
- bypass_visibility=is_internal_debug_read,
+ bypass_visibility=bypass_visibility,
for_control=not is_read_only,
):
raise NotFound("Task not found")
@@ -2042,13 +2049,10 @@ class TaskRunLivingArtifactViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewS
def _ensure_task_accessible(self) -> str:
"""Gate access to the parent task, mirroring ``TaskRunViewSet._ensure_task_accessible``."""
task_id = self._task_id()
- is_internal_debug_read = (
- _is_internal_debug_team(self.team_id)
- and self.action in ("list", "retrieve")
- and self.request.query_params.get("ph_debug") == "true"
- )
+ is_read = self.action in ("list", "retrieve")
+ bypass_visibility = is_read and _can_bypass_visibility(self.request, self.team_id)
if not tasks_facade.task_accessible_for_run_view(
- task_id, self.team_id, getattr(self.request.user, "id", None), bypass_visibility=is_internal_debug_read
+ task_id, self.team_id, getattr(self.request.user, "id", None), bypass_visibility=bypass_visibility
):
raise NotFound("Task not found")
return task_id
diff --git a/products/tasks/backend/tests/test_api.py b/products/tasks/backend/tests/test_api.py
index 4a5446b13828..9d524b5cba6f 100644
--- a/products/tasks/backend/tests/test_api.py
+++ b/products/tasks/backend/tests/test_api.py
@@ -749,6 +749,91 @@ class TestTaskVisibilityInternalDebugTeamBypass(BaseTaskAPITest):
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
+class TestTaskStaffVisibilityBypass(BaseTaskAPITest):
+ """Staff users can READ any task/run on the team, unconditionally — no ``?ph_debug=true`` opt-in
+ (unlike internal-debug teams), because the frontend can't reliably thread a query param through
+ every read (the SSE stream carries none). The ``all_team_tasks=true`` list filter stays opt-in so
+ the default list is unchanged. Non-staff users can't reach either, and writes stay creator-scoped.
+ The internal-debug-team ``?ph_debug=true`` path is covered by ``TestTaskVisibilityInternalDebugTeamBypass``."""
+
+ def setUp(self):
+ super().setUp()
+ # self.user is the authenticated requester (it resolves `@current`); make it staff and
+ # attribute the tasks under test to a different member so they're "not mine".
+ self.user.is_staff = True
+ self.user.save(update_fields=["is_staff"])
+ self.other_user = self.create_organization_user("teammate")
+
+ def test_staff_all_team_tasks_filter_includes_other_user_tasks(self):
+ theirs = self.create_task("Theirs", created_by=self.other_user)
+
+ response = self.client.get("/api/projects/@current/tasks/?all_team_tasks=true")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+ ids = {item["id"] for item in response.json()["results"]}
+ assert str(theirs.id) in ids
+
+ def test_staff_list_without_filter_still_excludes_other_user_tasks(self):
+ # The filter is opt-in — the default list stays creator-scoped even for staff.
+ theirs = self.create_task("Theirs", created_by=self.other_user)
+
+ response = self.client.get("/api/projects/@current/tasks/")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+ ids = {item["id"] for item in response.json()["results"]}
+ assert str(theirs.id) not in ids
+
+ def test_non_staff_all_team_tasks_filter_is_ignored(self):
+ self.user.is_staff = False
+ self.user.save(update_fields=["is_staff"])
+ theirs = self.create_task("Theirs", created_by=self.other_user)
+
+ response = self.client.get("/api/projects/@current/tasks/?all_team_tasks=true")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+ ids = {item["id"] for item in response.json()["results"]}
+ assert str(theirs.id) not in ids
+
+ def test_staff_retrieve_other_user_task_needs_no_ph_debug(self):
+ # No opt-in param — a staff user opening a teammate's task by URL just works.
+ task = self.create_task(created_by=self.other_user)
+
+ response = self.client.get(f"/api/projects/@current/tasks/{task.id}/")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+ self.assertEqual(response.json()["id"], str(task.id))
+
+ def test_non_staff_retrieve_other_user_task_still_404s(self):
+ self.user.is_staff = False
+ self.user.save(update_fields=["is_staff"])
+ task = self.create_task(created_by=self.other_user)
+
+ response = self.client.get(f"/api/projects/@current/tasks/{task.id}/")
+ self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
+
+ def test_staff_list_runs_for_other_user_task_needs_no_ph_debug(self):
+ task = self.create_task(created_by=self.other_user)
+ run = TaskRun.objects.create(task=task, team=self.team, status=TaskRun.Status.IN_PROGRESS)
+
+ response = self.client.get(f"/api/projects/@current/tasks/{task.id}/runs/")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+ ids = {item["id"] for item in response.json()["results"]}
+ self.assertEqual(ids, {str(run.id)})
+
+ def test_staff_list_living_artifacts_for_other_user_run(self):
+ # Living artifacts are a separate run-read viewset whose gate previously required an
+ # internal-debug team — staff must reach it on any team too.
+ task = self.create_task(created_by=self.other_user)
+ run = TaskRun.objects.create(task=task, team=self.team, status=TaskRun.Status.IN_PROGRESS)
+
+ response = self.client.get(f"/api/projects/@current/tasks/{task.id}/runs/{run.id}/living_artifacts/")
+ self.assertEqual(response.status_code, status.HTTP_200_OK)
+
+ @patch("products.tasks.backend.temporal.client.execute_task_processing_workflow")
+ def test_staff_write_on_other_user_task_still_404s(self, _mock_workflow):
+ # Read-only bypass — staff still can't drive another member's task.
+ task = self.create_task(created_by=self.other_user)
+
+ response = self.client.post(f"/api/projects/@current/tasks/{task.id}/run/")
+ self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
+
+
class TestTaskVisibilityInternalDebugRegionGate(BaseTaskAPITest):
"""The internal-debug bypass keys on team-id 2 — but that's only meaningful in
the US-prod DB. On EU prod, self-hosted, and dev, team-id 2 belongs to some
diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.ts
index 5a34db2382f4..fefdabcd4daf 100644
--- a/products/tasks/frontend/generated/api.schemas.ts
+++ b/products/tasks/frontend/generated/api.schemas.ts
@@ -2716,6 +2716,10 @@ export type TaskMentionsListParams = {
}
export type TasksListParams = {
+ /**
+ * Staff-only. When true, list every task on the team regardless of creator or channel, bypassing the per-user visibility filter. Ignored for non-staff users.
+ */
+ all_team_tasks?: boolean
/**
* Filter by archived state. Defaults to excluding archived tasks. Use 'true' to list only archived tasks, 'false' for the default, or 'all' to include both.
*
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 87c0c9141f5e..02ba6b2761e3 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -74643,6 +74643,10 @@ export namespace Schemas {
};
export type TasksListParams = {
+ /**
+ * Staff-only. When true, list every task on the team regardless of creator or channel, bypassing the per-user visibility filter. Ignored for non-staff users.
+ */
+ all_team_tasks?: boolean;
/**
* Filter by archived state. Defaults to excluding archived tasks. Use 'true' to list only archived tasks, 'false' for the default, or 'all' to include both.
*
diff --git a/services/mcp/src/generated/tasks/api.ts b/services/mcp/src/generated/tasks/api.ts
index db9da667e034..a2ba2dd087a9 100644
--- a/services/mcp/src/generated/tasks/api.ts
+++ b/services/mcp/src/generated/tasks/api.ts
@@ -20,6 +20,7 @@ export const TasksListParams = /* @__PURE__ */ zod.object({
),
})
+export const tasksListQueryAllTeamTasksDefault = false
export const tasksListQueryLimitDefault = 50
export const tasksListQueryLimitMax = 100
@@ -27,6 +28,12 @@ export const tasksListQueryOffsetDefault = 0
export const tasksListQueryOffsetMin = 0
export const TasksListQueryParams = /* @__PURE__ */ zod.object({
+ all_team_tasks: zod
+ .boolean()
+ .default(tasksListQueryAllTeamTasksDefault)
+ .describe(
+ 'Staff-only. When true, list every task on the team regardless of creator or channel, bypassing the per-user visibility filter. Ignored for non-staff users.'
+ ),
archived: zod
.enum(['true', 'false', 'all'])
.optional()
diff --git a/services/mcp/src/tools/generated/tasks.ts b/services/mcp/src/tools/generated/tasks.ts
index 86355f90436c..0cb6d2b15484 100644
--- a/services/mcp/src/tools/generated/tasks.ts
+++ b/services/mcp/src/tools/generated/tasks.ts
@@ -25,6 +25,7 @@ const tasksList = (): ToolBase<typeof TasksListSchema, WithPostHogUrl<Schemas.Pa
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/tasks/`,
query: {
+ all_team_tasks: params.all_team_tasks,
archived: params.archived,
channel: params.channel,
created_by: params.created_by,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json
index 057f33877fc7..84dde240b709 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/tasks-list.json
@@ -1,6 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
+ "all_team_tasks": {
+ "default": false,
+ "description": "Staff-only. When true, list every task on the team regardless of creator or channel, bypassing the per-user visibility filter. Ignored for non-staff users.",
+ "type": "boolean"
+ },
"archived": {
"description": "Filter by archived state. Defaults to excluding archived tasks. Use 'true' to list only archived tasks, 'false' for the default, or 'all' to include both.\n\n* `true` - true\n* `false` - false\n* `all` - all",
"enum": ["true", "false", "all"],