feat(intelligence): background agent command center UI (#3373)#3499
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
✅ Files skipped from review due to trivial changes (6)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughAdds a new Intelligence "agent-work" tab: typed frontend API client for ChangesAgent Work Intelligence Tab
Sequence Diagram(s)sequenceDiagram
participant User
participant IntelligenceAgentWorkTab as AgentWorkTab Component
participant agentWorkApi
participant CoreRPC as openhuman.agent_work_list
User->>IntelligenceAgentWorkTab: Navigate to agent-work tab
IntelligenceAgentWorkTab->>IntelligenceAgentWorkTab: Show loading UI
IntelligenceAgentWorkTab->>agentWorkApi: list(limit?)
agentWorkApi->>CoreRPC: Call openhuman.agent_work_list
CoreRPC-->>agentWorkApi: Return grouped response
agentWorkApi-->>IntelligenceAgentWorkTab: Typed AgentWorkResponse
IntelligenceAgentWorkTab->>IntelligenceAgentWorkTab: Group by bucket, format values
IntelligenceAgentWorkTab->>IntelligenceAgentWorkTab: Render buckets with rows
IntelligenceAgentWorkTab-->>User: Display agent work grouped by lifecycle state
User->>IntelligenceAgentWorkTab: Click "open thread" button
IntelligenceAgentWorkTab->>IntelligenceAgentWorkTab: Dispatch thread selection & loading
IntelligenceAgentWorkTab->>IntelligenceAgentWorkTab: Navigate to /chat
IntelligenceAgentWorkTab-->>User: Display thread details
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
598379b to
5b6415b
Compare
graycyrus
left a comment
There was a problem hiding this comment.
@oxoxDev hey! the code looks clean overall, but E2E lane 2/4 is showing a CI failure, so I'll hold off on approving until that's green — let me know if you need any help sorting it out.
one thing I noticed while reviewing: across all 13 non-English locale files (ar, bn, de, es, fr, hi, id, it, ko, pl, pt, ru, zh-CN), the bucket status labels working, completed, failed, stopped and all five column headers (agent, status, elapsed, cost, tokens) are left as English strings. needs_input is properly translated in every locale — the inconsistency within the same key group makes this look like oversight rather than intentional convention. your i18n Coverage (parity) check passes because the keys exist, but the values are English fallbacks. if these terms are meant to stay in English project-wide, a note in the i18n guide would help future contributors; if not, worth translating before this ships.
everything else is solid — mount pattern, component-local state, five-bucket render loop, typed API client, and test coverage (loading/error/empty/grouped) all look correct. the 0ms defer for the loading paint matches the sibling tab's approach. once CI is green, this is good to go.
|
Thanks for the careful review — both points addressed. i18n: Good catch, that was an oversight. Pushed E2E lane 2/4: That red isn't from this PR — it's a known flaky shard. It failed on a different test each run (composio harness first, then |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
app/src/components/intelligence/IntelligenceAgentWorkTab.tsx (2)
237-241: 🏗️ Heavy liftLocalize
statusandkindvalues before rendering.Line 237 and Line 240 render backend enum-like values directly. Those are user-visible and should go through
useT()mappings (with locale keys added across supported language files).As per coding guidelines, use
useT()fromapp/src/lib/i18n/I18nContextfor all user-facing UI text and add translation keys toen.tsand all locale files.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/components/intelligence/IntelligenceAgentWorkTab.tsx` around lines 237 - 241, In IntelligenceAgentWorkTab, don't render backend enum values row.status and row.kind directly; import and call useT() from app/src/lib/i18n/I18nContext in the IntelligenceAgentWorkTab component and replace direct renders with localized mappings (e.g. map status and kind values to translation keys like status.<value> and kind.<value> via useT()). Add the corresponding keys and strings to en.ts and mirror them in all locale files, and ensure the mapping accounts for unknown values (fallback to the raw value or a generic key).Source: Coding guidelines
213-219: ⚡ Quick winUse an
interfaceforAgentWorkRowItemprops.The inline object shape in the function signature should be promoted to a named interface to match project TypeScript conventions.
Proposed change
+interface AgentWorkRowItemProps { + row: AgentWorkRow; + onOpenThread: (threadId: string) => void; +} + function AgentWorkRowItem({ row, onOpenThread, -}: { - row: AgentWorkRow; - onOpenThread: (threadId: string) => void; -}) { +}: AgentWorkRowItemProps) {As per coding guidelines,
**/*.{ts,tsx}: Always useinterfacefor defining object shapes in TypeScript.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/components/intelligence/IntelligenceAgentWorkTab.tsx` around lines 213 - 219, The function AgentWorkRowItem currently types its props inline; extract that inline object into a named interface (e.g., interface AgentWorkRowItemProps) and update the function signature to accept (props: AgentWorkRowItemProps) or destructure ({ row, onOpenThread }: AgentWorkRowItemProps). Ensure the interface references the existing AgentWorkRow type and the onOpenThread signature (onOpenThread: (threadId: string) => void) so types remain identical and conform to the project convention of using interfaces for prop shapes.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/services/api/agentWorkApi.ts`:
- Around line 64-69: The list method currently forwards any numeric limit to
callCoreRpc; add client-side validation in the list function to reject
non-integer or negative limits (e.g., if limit is provided ensure
Number.isInteger(limit) && limit >= 0) and throw a clear TypeError or RangeError
when invalid, otherwise pass params as now to openhuman.agent_work_list; update
the list function's parameter handling (referencing list, callCoreRpc, and
AgentWorkResponse) to enforce this check before making the RPC call.
- Around line 66-69: Replace direct frontend core RPC call via callCoreRpc with
the mandated relay invocation: instead of calling callCoreRpc({...}) in
agentWorkApi.ts (the call using method 'openhuman.agent_work_list' and params
built from limit), call the frontend invoke function with channel
'core_rpc_relay' and pass an object containing method and params (preserve the
same params logic for limit) so the relay proxies the core RPC; keep the
expected response shape (AgentWorkResponse) handling the same after the invoke
call.
---
Nitpick comments:
In `@app/src/components/intelligence/IntelligenceAgentWorkTab.tsx`:
- Around line 237-241: In IntelligenceAgentWorkTab, don't render backend enum
values row.status and row.kind directly; import and call useT() from
app/src/lib/i18n/I18nContext in the IntelligenceAgentWorkTab component and
replace direct renders with localized mappings (e.g. map status and kind values
to translation keys like status.<value> and kind.<value> via useT()). Add the
corresponding keys and strings to en.ts and mirror them in all locale files, and
ensure the mapping accounts for unknown values (fallback to the raw value or a
generic key).
- Around line 213-219: The function AgentWorkRowItem currently types its props
inline; extract that inline object into a named interface (e.g., interface
AgentWorkRowItemProps) and update the function signature to accept (props:
AgentWorkRowItemProps) or destructure ({ row, onOpenThread }:
AgentWorkRowItemProps). Ensure the interface references the existing
AgentWorkRow type and the onOpenThread signature (onOpenThread: (threadId:
string) => void) so types remain identical and conform to the project convention
of using interfaces for prop shapes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9408a2fa-f6e2-4eb9-9938-7b41d3b354b8
📒 Files selected for processing (19)
app/src/components/intelligence/IntelligenceAgentWorkTab.test.tsxapp/src/components/intelligence/IntelligenceAgentWorkTab.tsxapp/src/lib/i18n/ar.tsapp/src/lib/i18n/bn.tsapp/src/lib/i18n/de.tsapp/src/lib/i18n/en.tsapp/src/lib/i18n/es.tsapp/src/lib/i18n/fr.tsapp/src/lib/i18n/hi.tsapp/src/lib/i18n/id.tsapp/src/lib/i18n/it.tsapp/src/lib/i18n/ko.tsapp/src/lib/i18n/pl.tsapp/src/lib/i18n/pt.tsapp/src/lib/i18n/ru.tsapp/src/lib/i18n/zh-CN.tsapp/src/pages/Intelligence.tsxapp/src/services/api/agentWorkApi.test.tsapp/src/services/api/agentWorkApi.ts
|
@coderabbitai triaged this round on #3499: Accepted (pushed in 6016943):
Skipped (with reason):
vitest 9/9, typecheck clean. |
|
Tip For best results, initiate chat on the files or code changes.
Accepted items (6016943): All three look solid — client-side guard on
Nothing blocking on my end from this round. The i18n parity confirmation and the 9/9 vitest all passing is reassuring. 🐇✨ ✏️ Learnings added
|
|
@graycyrus bro need approval here |
graycyrus
left a comment
There was a problem hiding this comment.
The three follow-up commits close out everything from the first review.
i18n gap: all 13 non-English locales now have proper translations across every bucket, column, status, and kind key — no more English strings leaking through. STATUS_LABEL_KEY and KIND_LABEL_KEY extend the same constant-map pattern cleanly, and the fallback to the raw backend value means new Rust enum variants won't break the UI.
Limit validation: the guard in agentWorkApi.list is correct — strict positive-integer check before any RPC dispatch, test covers 0, -5, and 1.5 boundaries.
The core_rpc_relay pushback was also right and precisely explained — callCoreRpc is the correct abstraction and keeping it consistent with every other sibling API client is the right call.
CI is 100% green, no remaining issues. LGTM.
Summary
openhuman.agent_work_listRPC added in feat(agent_orchestration): background command-center run list (#3373) #3497; read-only.agentWorkApiclient,IntelligenceAgentWorkTabcomponent, tab registration, and i18n across all 14 locales.Problem
#3497 shipped the backend (
agent_work_list) but nothing surfaces it. Users have no view of background agent runs grouped by what needs their attention.Solution
app/src/services/api/agentWorkApi.ts— typed client overopenhuman.agent_work_list.app/src/components/intelligence/IntelligenceAgentWorkTab.tsx— fetch-on-mount, loading/error/empty states, five status sections, per-row agent/status/elapsed/cost/tokens, open-thread / open-worker actions. Component-local state (matches sibling tabs), no Redux slice.app/src/pages/Intelligence.tsx— registers theagent-worktab (URL-param persistence preserved).Submission Checklist
Closes #NNN— PR2 of multi-PR Build a background agent command center #3373; closes on the final slice.Impact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Commit & Branch
feat/3373-command-center-ui598379b6c3eabea2f353b41967e14770c2d99d7eValidation Run
pnpm typecheck— passpnpm lint— pass (0 errors in changed files)vitest run IntelligenceAgentWorkTab.test.tsx agentWorkApi.test.ts— 8 passedpnpm i18n:check) — passBehavior Changes
Summary by CodeRabbit
New Features
Tests
Documentation