Skip to content

feat(agents): agent runs in inbox#2840

Open
jordan-umusu wants to merge 4 commits into
mainfrom
feat/visualize-agent-runs
Open

feat(agents): agent runs in inbox#2840
jordan-umusu wants to merge 4 commits into
mainfrom
feat/visualize-agent-runs

Conversation

@jordan-umusu

@jordan-umusu jordan-umusu commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Show agent runs in the Inbox with a grouped, sortable table and per‑group pagination. Adds an EE provider, creator context, search/group filters, and switches the sidebar to “Inbox”; single‑provider requests now use SQL keyset pagination for better performance.

  • New Features

    • Added agent_run item type and created_by (UserSummary) with avatar/name in UI.
    • EE AgentRunsInboxProvider (root Claude Code runs + legacy workflow approvals) with status/preview, pending count, and grouped listing with server-side cursors; service now delegates SQL keyset pagination when only one provider.
    • API: GET /inbox/items adds search (title/ID/workflow alias/title) and group (filter by InboxGroup); client/schemas updated.
    • UI/UX: RunsTable grouped by status with independent “Show more”; global sortable header (Title, Source, Created by, Created, Updated); keyboard-friendly rows, sticky group headers, timestamp tooltips; inline delete for “Review required”; debounced search with keep-previous-data and faster polling for active groups.
  • Migration

    • Regenerate frontend API client to pick up InboxGroup, group, search, UserSummary, and agent_run.
    • Deploy tracecat-ee with the new AgentRunsInboxProvider.

Written for commit a2792cc. Summary will update on new commits.

Review in cubic

image

@jordan-umusu jordan-umusu added ui Improvements or additions to UI/UX agents LLM agents labels Jun 9, 2026
@jordan-umusu jordan-umusu force-pushed the feat/visualize-agent-runs branch from 8877cb4 to e4bbe94 Compare June 9, 2026 22:18
@jordan-umusu jordan-umusu marked this pull request as ready for review June 9, 2026 22:18

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

stmt = base_stmt.order_by(order_clause, id_order).limit(limit + 1)

P1 Badge Prioritize pending approvals before limiting agent runs

When a workspace has more than the fetched window of newer non-pending Claude Code runs, this limit is applied before _enrich_sessions() computes whether any older session has pending approvals. The inbox UI calls inboxListItems with the default created-at ordering, so a pending approval can be omitted from the returned rows even though count_pending_items() still includes it, leaving the Review required section empty while the badge shows pending work. Fetch pending-approval sessions separately or order them ahead of ordinary runs before applying the limit.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 issues found across 16 files

Confidence score: 3/5

  • There is a concrete privacy/RBAC risk in packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py: creator email/name can be pulled from global user records without workspace-membership scoping, which could expose PII in inbox responses.
  • This is not a merge-blocker by itself, but the combination of medium-severity behavior changes in search paths (frontend/src/hooks/use-inbox.ts, tracecat/inbox/router.py) adds regression risk for user-visible filtering and query handling.
  • UI behavior in frontend/src/components/inbox/runs-table.tsx may trigger unintended row selection/navigation when activating the nested delete button, so keyboard interactions need a quick validation pass.
  • Pay close attention to packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py, frontend/src/hooks/use-inbox.ts, tracecat/inbox/router.py, frontend/src/components/inbox/runs-table.tsx - privacy scoping and search/interaction edge cases are the main risk areas.

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

Re-trigger cubic

Comment thread frontend/src/components/inbox/runs-table.tsx
Comment thread frontend/src/hooks/use-inbox.ts Outdated
Comment thread tracecat/inbox/router.py
Comment thread packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py
Comment thread frontend/src/hooks/use-inbox.ts Outdated
@zeropath-ai

zeropath-ai Bot commented Jun 9, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to d86d592.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► frontend/src/client/schemas.gen.ts
    Add created_by field to InboxItemRead schema
    Add agent_run to InboxItemType enum
    Add UserSummary schema
► frontend/src/client/services.gen.ts
    Add search parameter to inboxListItems
► frontend/src/client/types.gen.ts
    Add created_by to InboxItemRead type
    Add agent_run to InboxItemType
    Add UserSummary type
    Add search parameter to InboxListItemsData
► frontend/src/components/inbox/index.tsx
    Replace ActivityAccordion with RunsTable
► frontend/src/components/inbox/runs-table.tsx
    Implement RunsTable component
    Add sortable columns for agent runs
    Group agent runs by status
    Add delete confirmation for approvals
► frontend/src/hooks/use-inbox.ts
    Add search functionality to useInbox hook
    Include created_by and workflow data in session items
    Update query keys to include search parameter
    Use keepPreviousData for pagination
► frontend/src/lib/agents.ts
    Add created_by field to InboxSessionItem interface
► packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py
    Rename ApprovalsInboxProvider to AgentRunsInboxProvider
    Update list_items to filter for Claude Code runs and legacy sessions with approvals
    Add search functionality to list_items
    Include created_by and workflow metadata in InboxItemRead
    Distinguish between Approval and AgentRun item types
Refactor ► frontend/src/components/inbox/activity-accordion.tsx
    Remove ActivityAccordion component
► frontend/src/components/inbox/activity-item.tsx
    Remove ActivityItem component
► frontend/src/components/sidebar/app-sidebar.tsx
    Rename "Approvals" to "Inbox" in sidebar navigation
Other ► frontend/src/components/inbox/runs-table.tsx
    Add user avatar and name display
► frontend/src/hooks/use-debounce.ts
    Add useDebounce hook for search input debouncing

@jordan-umusu jordan-umusu requested a review from topher-lo June 10, 2026 13:19

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d86d5921e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 922e19a9cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py Outdated

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 issues found across 13 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread frontend/src/hooks/use-inbox.ts Outdated
Comment thread frontend/src/hooks/pagination/use-cursor-pagination.tsx Outdated
Comment thread tracecat/inbox/service.py Outdated
Comment thread frontend/src/hooks/use-inbox.ts Outdated
Comment thread packages/tracecat-ee/tracecat_ee/inbox/providers/agent_runs.py

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2792cc53b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +170 to 178
if group is not None:
return await self._list_items_grouped(
limit=limit,
cursor=cursor,
order_by=order_by,
sort=sort,
search=search,
group=group,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Thread reverse through grouped pagination

When a client asks for a previous page with group=...&reverse=true&cursor=..., this branch never passes reverse into the grouped scanner, so _list_items_grouped always applies the forward keyset predicate and returns the next older page rather than the newer items before the cursor. The route still exposes reverse and grouped responses can return prev_cursor, so back-pagination for grouped inbox results is broken unless reverse is handled here (or previous cursors are not advertised for grouped pages).

Useful? React with 👍 / 👎.

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

Labels

agents LLM agents ui Improvements or additions to UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant