Skip to content

feat(agents): preview subagent activity inline - #52

Merged
w0wl0lxd merged 4 commits into
mainfrom
feat/subagent-activity-preview
Jul 22, 2026
Merged

w0wl0lxd merged 4 commits into
mainfrom
feat/subagent-activity-preview

Conversation

@w0wl0lxd

@w0wl0lxd w0wl0lxd commented Jul 21, 2026 •

Copy link
Copy Markdown
Owner

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

  • feat - new functionality
  • fix - review follow-ups
  • docs - documentation only
  • style - formatting / no logic change
  • refactor - code restructure, same behavior
  • perf - performance improvement
  • test - tests only
  • build - build / deps / tooling
  • ci - CI/workflow changes
  • chore - housekeeping
  • revert - revert a change

Changelog fragment

  • Added changelog.d/subagent-activity-preview.added.md

Test plan

  • cargo fmt --all -- --check
  • stylua --check for every changed Lua file
  • relevant lib, task, and team plugin specs
  • RUST_TEST_THREADS=1 cargo test -p n00n-lua (810 passed)
  • cargo test -p n00n-ui (1133 passed, 1 ignored)
  • focused completed/nested card click and Ctrl+X picker tests
  • cargo clippy -p n00n-lua --tests -- -D warnings
  • cargo run -p n00n-docgen -- --check
  • git diff --check

cargo clippy -p n00n-ui --tests -- -D warnings still reaches inherited strict-lint failures in untouched UI code. The first diagnostic is n00n-ui/src/components/command.rs:549; no new diagnostic points at the activity-preview changes.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Subagent 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.

Changes

Activity preview experience

Layer / File(s) Summary
Turn-safe activity progress
n00n-lua/src/api/agent.rs, n00n-lua/tests/task_policy.rs
Progress tracks sanitized tool activities, turn identifiers, forwarder barriers, statuses, and bounded activity history.
Preview component and rendering limits
plugins/lib/n00n/activity_preview.lua, plugins/lib/n00n/tool_view.lua, plugins/lib/tests/spec.lua
Activity previews render session rows and statuses, while ToolView applies UTF-8-safe byte and display-width truncation.
Task preview execution
plugins/task/init.lua
Task prompts and structured-output retries use ActivityPreview, and task results include the preview buffer.
Team execution preview propagation
plugins/team/init.lua, plugins/team/roles.lua, plugins/team/quorum.lua, plugins/team/swarm.lua, plugins/team/tests/spec.lua
A shared preview is propagated through supervisor, role, swarm, and quorum execution paths.
Inline card interaction behavior
n00n-ui/src/app/mouse.rs, n00n-ui/src/app/tests.rs, changelog.d/subagent-activity-preview.added.md
Task card clicks toggle inline content without navigation; picker selection performs explicit navigation, and the behavior is documented.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • w0wl0lxd/n00n#20: Overlaps task prompting and structured-output retry changes.
  • w0wl0lxd/n00n#21: Overlaps UI click routing and task/session execution changes.

Poem

I’m a rabbit with previews, hopping in line,
Five little rows render neatly and fine.
Secrets hide safely, tools softly glow,
Cards stay inline when you click them just so.
Pickers hop onward when navigation’s due—
A tidy activity trail for you!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and clearly reflects the main change: inline previewing of subagent activity.
Description check ✅ Passed The description matches the changeset and summarizes the new inline activity previews, click behavior, and follow-up fixes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/subagent-activity-preview

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.05668% with 177 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
n00n-providers/src/providers/openai/websocket.rs 85.73% 85 Missing ⚠️
n00n-lua/src/api/agent.rs 88.86% 47 Missing ⚠️
n00n-providers/src/providers/openai/platform.rs 88.92% 39 Missing ⚠️
n00n-providers/src/providers/openai/responses.rs 94.11% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@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: 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".

Comment thread n00n-lua/src/api/agent.rs Outdated
Comment thread n00n-lua/src/api/agent.rs Outdated

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 71caba7 and d5ad31e.

📒 Files selected for processing (14)
  • changelog.d/subagent-activity-preview.added.md
  • n00n-lua/src/api/agent.rs
  • n00n-lua/tests/task_policy.rs
  • n00n-ui/src/app/mouse.rs
  • n00n-ui/src/app/tests.rs
  • plugins/lib/n00n/activity_preview.lua
  • plugins/lib/n00n/tool_view.lua
  • plugins/lib/tests/spec.lua
  • plugins/task/init.lua
  • plugins/team/init.lua
  • plugins/team/quorum.lua
  • plugins/team/roles.lua
  • plugins/team/swarm.lua
  • plugins/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 ./plugins and should follow the repository's plugin/tool execution trust-boundary requirements.

Files:

  • plugins/team/roles.lua
  • plugins/team/quorum.lua
  • plugins/team/swarm.lua
  • plugins/lib/n00n/activity_preview.lua
  • plugins/lib/n00n/tool_view.lua
  • plugins/team/tests/spec.lua
  • plugins/task/init.lua
  • plugins/lib/tests/spec.lua
  • plugins/team/init.lua
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Run cargo 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 use unwrap, expect, panic!, todo!, unimplemented!, or dbg! in production Rust code.
Do not silently discard errors with unwrap_or, unwrap_or_default, .ok() on Result, 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 with Result<T, E> rather than panics; propagate errors with ?, ok_or_else, and map_err.
Use thiserror for domain-specific errors in library crates and color-eyre at 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 derive Copy for 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.rs
  • n00n-ui/src/app/tests.rs
  • n00n-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!

Comment thread n00n-lua/src/api/agent.rs
Comment thread plugins/task/init.lua Outdated
Comment thread plugins/team/init.lua Outdated
Comment thread plugins/team/init.lua
Comment thread plugins/team/tests/spec.lua
@w0wl0lxd

Copy link
Copy Markdown
Owner Author

@codex review

@w0wl0lxd

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 697505015d

ℹ️ 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".

@w0wl0lxd
w0wl0lxd changed the base branch from main to perf/token-savings-observability July 22, 2026 00:22
@w0wl0lxd
w0wl0lxd changed the base branch from perf/token-savings-observability to main July 22, 2026 00:22
@w0wl0lxd

Copy link
Copy Markdown
Owner Author

Check triage before merge:

  • All review threads are resolved and CodeRabbit approved the updated head.
  • Feature tests, coverage, builds, formatting, docs, Rustdoc, dependency review, secrets, links, spelling, and changelog checks pass.
  • The remaining non-required failures reproduce on current base 15f9214c2: Linux lint setup cannot resolve just; Windows lint fails on the pre-existing n00n-storage/src/lib.rs:163 unused parameter; MSRV, Rust CodeQL, and Criterion fail on pre-existing denied unsafe in n00n-lua/benches/luau_perf.rs.
  • This PR additionally fixes the base docs drift, so its Docs check passes.

@w0wl0lxd
w0wl0lxd merged commit 949672b into main Jul 22, 2026
23 of 29 checks passed
@w0wl0lxd
w0wl0lxd deleted the feat/subagent-activity-preview branch July 24, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant