Repository navigation
feat(agents): preview subagent activity inline - #52
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
📝 WalkthroughWalkthroughSubagent progress now exposes sanitized, turn-aware activity rows. New task and team preview components render those rows with bounded truncation, while task cards toggle inline and picker selection handles explicit navigation. ChangesActivity preview experience
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5ad31e043
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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 `@n00n-lua/src/api/agent.rs`:
- Around line 881-891: Bound the session-scoped started_activity_ids and
completed_activity_ids caches in ProgressState so they cannot grow indefinitely
after activities are evicted. Prune IDs together with the activities deque when
enforcing its retention limit, or clear both caches at the established
session/turn completion path; preserve IDs still needed for active activity
tracking.
In `@plugins/task/init.lua`:
- Line 224: Rename the local description in the handler to task_description to
avoid shadowing the outer description upvalue, and update both nearby
preview:prompt calls to use task_description.
In `@plugins/team/init.lua`:
- Around line 208-211: Update the preview prompt calls in the surrounding
initialization flow to discard their unused result value while retaining the
error value in rerr and the existing captured check. Apply this to both
opts._preview:prompt invocations without changing their prompt arguments or
control flow.
- Around line 412-424: Wrap the foreground run_team call in handler with pcall,
matching the protected flow in task/init.lua, so both successful results and
raised errors are converted into a result table. Ensure result.body is assigned
from preview.view.buf before returning, while preserving the existing background
path and preview-creation error response.
In `@plugins/team/tests/spec.lua`:
- Around line 300-316: Extend the routing tests in the shown spec to cover
team/init.lua’s supervisor preview path: reuse stub_agent, invoke the team
supervisor flow that reaches run_supervisor, capture opts._preview:prompt
arguments, and assert the supervisor label is routed correctly. Also cover swarm
per-agent activity_label composition if that path is exposed by the existing
test helpers, while preserving the current quorum assertions.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 0e5a8067-eac3-4203-9754-94c10b686368
📒 Files selected for processing (14)
changelog.d/subagent-activity-preview.added.mdn00n-lua/src/api/agent.rsn00n-lua/tests/task_policy.rsn00n-ui/src/app/mouse.rsn00n-ui/src/app/tests.rsplugins/lib/n00n/activity_preview.luaplugins/lib/n00n/tool_view.luaplugins/lib/tests/spec.luaplugins/task/init.luaplugins/team/init.luaplugins/team/quorum.luaplugins/team/roles.luaplugins/team/swarm.luaplugins/team/tests/spec.lua
💤 Files with no reviewable changes (1)
- n00n-ui/src/app/mouse.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
- GitHub Check: MSRV (1.97)
- GitHub Check: Docs
- GitHub Check: Lint
- GitHub Check: Lint (Windows)
- GitHub Check: Build (Windows)
- GitHub Check: Coverage
- GitHub Check: Test
- GitHub Check: Criterion
- GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (2)
plugins/**/*.lua
📄 CodeRabbit inference engine (AGENTS.md)
Built-in Lua plugins are located under
./pluginsand should follow the repository's plugin/tool execution trust-boundary requirements.
Files:
plugins/team/roles.luaplugins/team/quorum.luaplugins/team/swarm.luaplugins/lib/n00n/activity_preview.luaplugins/lib/n00n/tool_view.luaplugins/team/tests/spec.luaplugins/task/init.luaplugins/lib/tests/spec.luaplugins/team/init.lua
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Runcargo fmt --all,cargo check --all,cargo clippy --all --tests -- -D warnings, and workspace tests for Rust changes.
Workspace Rust code must deny unsafe code; new unsafe requires written review, an explicit lint exception, and a SAFETY comment.
Do not useunwrap,expect,panic!,todo!,unimplemented!, ordbg!in production Rust code.
Do not silently discard errors withunwrap_or,unwrap_or_default,.ok()onResult, or equivalent defaulting patterns; return typed errors or use an explicitly logged fallback.
Do not use wildcard imports; import types at the top of the file and use short names rather than fully qualified inline paths.
Keep constants at the top of Rust files immediately after imports.
Use explicit error handling withResult<T, E>rather than panics; propagate errors with?,ok_or_else, andmap_err.
Usethiserrorfor domain-specific errors in library crates andcolor-eyreat binary edges.
Avoid inline magic numbers and strings, unnecessary state, trivial comments, and unnecessary code; keep code minimal and follow Rust idioms.
Use descriptive variable and function names.
Only deriveCopyfor structs containing one primitive field.
Prefer structured logging with useful fields and provide helpful, sanitized error messages.
Use#[test_case]where appropriate and use snake_case test names.
Tests must verify meaningful behavior, avoid tautologies, sleeps, and other flaky constructs, and assert shared constants for repeated error or status messages.
Treat LLM and provider output as untrusted input; validate schemas, domain constraints, and source evidence before persistence or action.
Do not commit credentials, API keys, tokens, cookies, authorization headers, or user data, and do not log raw provider payloads, prompts, credentials, or session data.
Validate and authorize HTTP, file, queue, configuration, environment, LLM, and provider-callback inputs before mutation or persistence.
Tool execution requir...
Files:
n00n-lua/tests/task_policy.rsn00n-ui/src/app/tests.rsn00n-lua/src/api/agent.rs
🪛 Luacheck (1.2.0)
plugins/task/init.lua
[warning] 224-224: shadowing upvalue 'description' on line 50
(W431)
plugins/lib/tests/spec.lua
[warning] 1376-1376: unused argument 'self'
(W212)
[warning] 1407-1407: unused argument 'self'
(W212)
plugins/team/init.lua
[warning] 208-208: variable 'res' is never accessed
(W231)
🪛 markdownlint-cli2 (0.23.0)
changelog.d/subagent-activity-preview.added.md
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🔇 Additional comments (25)
n00n-lua/src/api/agent.rs (7)
570-578: LGTM!
739-810: LGTM!
812-854: LGTM!
893-1056: LGTM!
1094-1094: LGTM!Also applies to: 1183-1183, 1224-1251
1312-1329: LGTM!
1395-1575: LGTM!n00n-lua/tests/task_policy.rs (1)
148-156: LGTM!plugins/lib/n00n/activity_preview.lua (3)
20-50: LGTM!
52-92: LGTM!
94-133: LGTM!plugins/lib/n00n/tool_view.lua (3)
23-63: LGTM!
65-126: LGTM!
131-131: LGTM!Also applies to: 149-149, 251-251, 273-280
plugins/lib/tests/spec.lua (3)
164-210: LGTM!
313-333: LGTM!
1372-1445: LGTM!plugins/task/init.lua (1)
8-8: LGTM!Also applies to: 225-228, 251-255, 278-290
plugins/team/init.lua (1)
6-6: LGTM!Also applies to: 255-258, 281-284, 325-410, 390-393
plugins/team/quorum.lua (1)
56-61: LGTM!plugins/team/roles.lua (1)
71-76: LGTM!plugins/team/swarm.lua (1)
115-122: LGTM!Also applies to: 136-136
plugins/team/tests/spec.lua (1)
100-132: LGTM!Also applies to: 300-316
n00n-ui/src/app/tests.rs (1)
1006-1074: LGTM!Also applies to: 1168-1225
changelog.d/subagent-activity-preview.added.md (1)
1-1: LGTM!
# Conflicts: # n00n-lua/src/api/agent.rs # plugins/task/init.lua # plugins/team/init.lua
|
@codex review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Check triage before merge:
|
Summary
Add deterministic, sanitized five-row activity previews to foreground task and team cards. Card clicks expand or collapse the inline preview without changing the active chat. Ctrl+X and Enter remain the explicit path to a full agent session.
The branch is rebased onto current
origin/main. Follow-up fixes handle repeated provider tool IDs, bound in-flight activity tracking, redact adjacent bearer tokens, protect team preview failures, and refresh generated docs.Type
Changelog fragment
changelog.d/subagent-activity-preview.added.mdTest plan
cargo fmt --all -- --checkstylua --checkfor every changed Lua fileRUST_TEST_THREADS=1 cargo test -p n00n-lua(810 passed)cargo test -p n00n-ui(1133 passed, 1 ignored)cargo clippy -p n00n-lua --tests -- -D warningscargo run -p n00n-docgen -- --checkgit diff --checkcargo clippy -p n00n-ui --tests -- -D warningsstill reaches inherited strict-lint failures in untouched UI code. The first diagnostic isn00n-ui/src/components/command.rs:549; no new diagnostic points at the activity-preview changes.