Repository navigation
fix(agents): restore controllable background sessions - #21
Conversation
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe pull request replaces the ALMAS plugin surface with Team, adds background-agent control and session cancellation, refactors task execution, updates Team orchestration, expands agent-focused UI behavior, and refreshes related tests and documentation. ChangesTeam and agent orchestration
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 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces background agent control capabilities, including a new agent_control plugin to list, inspect, steer, or stop background agents started by task or ALMAS. It also implements a cancel function in the Lua API and UI event loop to cancel the current turn of a live session, allows users to switch active chats by clicking on tool segments in the UI, and removes the adaptive prompt refinement (refine.lua) from ALMAS. Reviewer feedback suggests allowing cancellation of sessions in states other than Working (such as NeedsInput) by checking that the session is not Idle, and using a dynamic forwarded table pattern in the task plugin's background handler to improve maintainability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64b4d4b5dd
ℹ️ 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".
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
fix(agents): harden tasks and agent teams
Signed-off-by: w0wl0lxd <w0wl0lxd@tuta.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@plugins/task/init.lua`:
- Around line 151-165: Replace the background branch in the task handler with
the same detached subagent creation flow used by the synchronous path, invoking
n00n.agent.session(...) directly instead of creating a session with a
natural-language prompt. Preserve the background response contract while
ensuring subagent audience setup, early output_schema validation, and semaphore
gating occur during the initial spawn.
- Around line 277-297: Handle the result of the do_poll coroutine after
n00n.async.gather, rather than ignoring results[2]. If polling failures are not
best-effort, propagate results[2].err so the task fails; otherwise explicitly
log the polling error while preserving the existing prompt result handling.
In `@plugins/team/ibn.lua`:
- Around line 17-25: Update is_multi_step to match each MULTI_STEP keyword only
at a word boundary using Lua’s frontier pattern %f[%a], while preserving case
normalization and literal matching so substrings within larger words no longer
trigger a multi-step result.
In `@plugins/team/init.lua`:
- Line 396: Rename the unused input parameter in the finish_run function to
_input, preserving its position and all other parameters and behavior.
🪄 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: 23f3af1f-eff6-4e35-bd88-60372c553b34
📒 Files selected for processing (36)
AGENTS.mdn00n-config/src/lib.rsn00n-docgen/src/gen_tools.rsn00n-lua/src/api/agent.rsn00n-lua/src/api/session.rsn00n-lua/src/api/util/command.rsn00n-lua/src/loader.rsn00n-lua/tests/plugin_host.rsn00n-lua/tests/spec.rsn00n-lua/tests/task_policy.rsn00n-ui/src/app/mod.rsn00n-ui/src/app/mouse.rsn00n-ui/src/app/tests.rsn00n-ui/src/chat.rsn00n-ui/src/components/command.rsn00n-ui/src/components/messages/mod.rsn00n-ui/src/components/messages/tests.rsn00n-ui/src/components/status_bar.rsn00n-ui/src/event_loop.rsplugins/agent_control/init.luaplugins/almas/refine.luaplugins/lib/n00n/route_tier.luaplugins/task/init.luaplugins/team/ibn.luaplugins/team/init.luaplugins/team/mem.luaplugins/team/quorum.luaplugins/team/retrieve.luaplugins/team/roles.luaplugins/team/swarm.luaplugins/team/tests/spec.luascripts/team_demo.shsite/docs/content/commands/_index.mdsite/docs/content/configuration/_index.mdsite/docs/content/lua-api/_index.mdsite/docs/content/tools/_index.md
💤 Files with no reviewable changes (2)
- plugins/almas/refine.lua
- plugins/team/tests/spec.lua
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: Lint (Windows)
- GitHub Check: Build (Windows)
- GitHub Check: Test
🧰 Additional context used
📓 Path-based instructions (7)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Avoid unnecessary state, including variables, fields, and arguments; each line of code should justify its existence.
Follow Rust idioms and best practices, using current stable Rust features where appropriate.
Use descriptive variable and function names.
Do not use wildcard imports.
Import types at the top of the file and use short names instead of fully qualified inline paths.
Keep constants at the top of the file, immediately after imports.
Use explicit error handling withResult<T, E>instead of panics.
Usecolor_eyrewhen the specific error is not important, and use customthiserrorerror types for domain-specific errors.
Place unit tests in the same source file inside#[cfg(test)]modules.
Be mindful of allocations in hot paths.
Prefer structured logging with useful fields.
Provide helpful error messages.
Use#[test_case]for tests and snake_case names for test functions.
Do not add tautological or otherwise pointless tests.
Ensure tests are deterministic and do not use arbitrary sleeps.
Do not use inline magic numbers or strings.
In tests, define error and status messages as constants and assert against the shared constants.
Add#[derive(Copy)]only to structs with one primitive field.
Runcargo clippy --all --tests -- -D warningsandcargo nextest run --workspaceto validate changes.
Files:
n00n-lua/src/api/agent.rsn00n-ui/src/components/command.rsn00n-lua/tests/spec.rsn00n-ui/src/chat.rsn00n-ui/src/components/messages/mod.rsn00n-ui/src/event_loop.rsn00n-lua/src/api/util/command.rsn00n-ui/src/components/messages/tests.rsn00n-lua/tests/plugin_host.rsn00n-ui/src/components/status_bar.rsn00n-lua/src/api/session.rsn00n-lua/src/loader.rsn00n-docgen/src/gen_tools.rsn00n-ui/src/app/mod.rsn00n-ui/src/app/mouse.rsn00n-config/src/lib.rsn00n-ui/src/app/tests.rsn00n-lua/tests/task_policy.rs
n00n-lua/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Keep the Lua plugin system, with a Neovim-compatible API, in
n00n-lua.
Files:
n00n-lua/src/api/agent.rsn00n-lua/tests/spec.rsn00n-lua/src/api/util/command.rsn00n-lua/tests/plugin_host.rsn00n-lua/src/api/session.rsn00n-lua/src/loader.rsn00n-lua/tests/task_policy.rs
plugins/**/*.lua
📄 CodeRabbit inference engine (AGENTS.md)
Keep built-in Lua plugins under
./pluginsand preserve the listed plugin responsibilities.
Files:
plugins/team/retrieve.luaplugins/lib/n00n/route_tier.luaplugins/team/ibn.luaplugins/team/mem.luaplugins/team/swarm.luaplugins/team/quorum.luaplugins/agent_control/init.luaplugins/team/roles.luaplugins/task/init.luaplugins/team/init.lua
n00n-ui/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Implement the
n00n-uicrate using ratatui and an Elm-like architecture.
Files:
n00n-ui/src/components/command.rsn00n-ui/src/chat.rsn00n-ui/src/components/messages/mod.rsn00n-ui/src/event_loop.rsn00n-ui/src/components/messages/tests.rsn00n-ui/src/components/status_bar.rsn00n-ui/src/app/mod.rsn00n-ui/src/app/mouse.rsn00n-ui/src/app/tests.rs
site/docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Write user documentation in a warm, simple, concise, story-telling style suitable for non-native English readers; avoid em dashes, emojis, and AI-like tone.
Files:
site/docs/content/commands/_index.mdsite/docs/content/configuration/_index.mdsite/docs/content/tools/_index.mdsite/docs/content/lua-api/_index.md
n00n-docgen/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Generate site documentation through the
gen_*.rsgenerators and runjust gen-docsafter documentation changes.
Files:
n00n-docgen/src/gen_tools.rs
n00n-config/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Keep user-configuration functionality in
n00n-config.
Files:
n00n-config/src/lib.rs
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: w0wl0lxd/n00n
Timestamp: 2026-07-20T15:24:52.489Z
Learning: Avoid trivial comments.
Learnt from: CR
Repo: w0wl0lxd/n00n
Timestamp: 2026-07-20T15:24:52.489Z
Learning: Keep implementations minimal and avoid unnecessary bloat; follow KISS, DRY, and SRP.
🪛 Luacheck (1.2.0)
plugins/team/init.lua
[warning] 396-396: unused argument 'input'
(W212)
🔇 Additional comments (32)
site/docs/content/configuration/_index.md (2)
83-83: LGTM!
219-226: 📐 Maintainability & Code QualityWorkflow timeout default matches runtime.
plugins.workflow.timeout_secsalready usesDEFAULT_TIMEOUT_SECS = 600, so the docs stay aligned.n00n-lua/src/api/util/command.rs (1)
396-396: LGTM!n00n-lua/src/api/session.rs (1)
146-158: LGTM!Also applies to: 186-186, 231-252
n00n-ui/src/app/mod.rs (1)
97-98: LGTM!Also applies to: 489-513, 974-977
n00n-ui/src/event_loop.rs (1)
736-749: LGTM!n00n-lua/src/api/agent.rs (1)
148-148: LGTM!plugins/lib/n00n/route_tier.lua (1)
4-4: LGTM!n00n-ui/src/app/mouse.rs (1)
75-85: LGTM!site/docs/content/lua-api/_index.md (1)
826-826: LGTM!Also applies to: 2622-2637, 4891-4891
n00n-ui/src/chat.rs (1)
282-285: LGTM!n00n-ui/src/components/messages/mod.rs (1)
719-730: LGTM!n00n-ui/src/components/command.rs (1)
27-27: LGTM!AGENTS.md (1)
53-53: LGTM!n00n-config/src/lib.rs (1)
56-56: LGTM!Also applies to: 70-70
n00n-lua/src/loader.rs (1)
30-33: LGTM!Also applies to: 103-104, 667-675
plugins/team/retrieve.lua (1)
1-1: LGTM!plugins/team/roles.lua (1)
1-8: LGTM!plugins/team/swarm.lua (1)
39-39: LGTM!scripts/team_demo.sh (1)
2-35: LGTM!Also applies to: 58-58
n00n-lua/tests/plugin_host.rs (1)
3435-3445: LGTM!Also applies to: 3460-3462, 3477-3477
plugins/team/init.lua (1)
1-19: LGTM!Also applies to: 42-56, 66-68, 71-114, 135-138, 189-199, 215-224, 255-285, 290-335, 352-358, 386-395, 397-408, 410-423, 467-467, 482-491, 530-537, 548-552, 565-577, 622-630, 640-646, 656-662
plugins/team/mem.lua (1)
13-13: LGTM!plugins/team/quorum.lua (1)
47-47: LGTM!n00n-lua/tests/spec.rs (1)
7-7: LGTM!n00n-docgen/src/gen_tools.rs (1)
37-45: LGTM!site/docs/content/commands/_index.md (1)
16-16: LGTM!Also applies to: 34-37
site/docs/content/tools/_index.md (1)
10-10: LGTM!Also applies to: 158-214
plugins/team/ibn.lua (1)
1-16: LGTM!Also applies to: 27-36, 42-62
plugins/agent_control/init.lua (1)
1-90: LGTM!plugins/task/init.lua (1)
16-16: LGTM!Also applies to: 44-45, 81-84, 340-340
n00n-lua/tests/task_policy.rs (1)
417-439: 🩺 Stability & AvailabilityNo Lua-thread race here
exec_toolgoes through the tool request queue, and the Lua runtime handlesRequest::CallToolon its single dedicatedn00n-luathread. The three spawned OS threads only submit work; they do not enter the Lua VM concurrently.> Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 4
🤖 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 `@plugins/task/init.lua`:
- Around line 151-165: Replace the background branch in the task handler with
the same detached subagent creation flow used by the synchronous path, invoking
n00n.agent.session(...) directly instead of creating a session with a
natural-language prompt. Preserve the background response contract while
ensuring subagent audience setup, early output_schema validation, and semaphore
gating occur during the initial spawn.
- Around line 277-297: Handle the result of the do_poll coroutine after
n00n.async.gather, rather than ignoring results[2]. If polling failures are not
best-effort, propagate results[2].err so the task fails; otherwise explicitly
log the polling error while preserving the existing prompt result handling.
In `@plugins/team/ibn.lua`:
- Around line 17-25: Update is_multi_step to match each MULTI_STEP keyword only
at a word boundary using Lua’s frontier pattern %f[%a], while preserving case
normalization and literal matching so substrings within larger words no longer
trigger a multi-step result.
In `@plugins/team/init.lua`:
- Line 396: Rename the unused input parameter in the finish_run function to
_input, preserving its position and all other parameters and behavior.
🪄 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: 23f3af1f-eff6-4e35-bd88-60372c553b34
📒 Files selected for processing (36)
AGENTS.mdn00n-config/src/lib.rsn00n-docgen/src/gen_tools.rsn00n-lua/src/api/agent.rsn00n-lua/src/api/session.rsn00n-lua/src/api/util/command.rsn00n-lua/src/loader.rsn00n-lua/tests/plugin_host.rsn00n-lua/tests/spec.rsn00n-lua/tests/task_policy.rsn00n-ui/src/app/mod.rsn00n-ui/src/app/mouse.rsn00n-ui/src/app/tests.rsn00n-ui/src/chat.rsn00n-ui/src/components/command.rsn00n-ui/src/components/messages/mod.rsn00n-ui/src/components/messages/tests.rsn00n-ui/src/components/status_bar.rsn00n-ui/src/event_loop.rsplugins/agent_control/init.luaplugins/almas/refine.luaplugins/lib/n00n/route_tier.luaplugins/task/init.luaplugins/team/ibn.luaplugins/team/init.luaplugins/team/mem.luaplugins/team/quorum.luaplugins/team/retrieve.luaplugins/team/roles.luaplugins/team/swarm.luaplugins/team/tests/spec.luascripts/team_demo.shsite/docs/content/commands/_index.mdsite/docs/content/configuration/_index.mdsite/docs/content/lua-api/_index.mdsite/docs/content/tools/_index.md
💤 Files with no reviewable changes (2)
- plugins/almas/refine.lua
- plugins/team/tests/spec.lua
📜 Review details
🔇 Additional comments (32)
site/docs/content/configuration/_index.md (2)
83-83: LGTM!
219-226: 📐 Maintainability & Code QualityWorkflow timeout default matches runtime.
plugins.workflow.timeout_secsalready usesDEFAULT_TIMEOUT_SECS = 600, so the docs stay aligned.n00n-lua/src/api/util/command.rs (1)
396-396: LGTM!n00n-lua/src/api/session.rs (1)
146-158: LGTM!Also applies to: 186-186, 231-252
n00n-ui/src/app/mod.rs (1)
97-98: LGTM!Also applies to: 489-513, 974-977
n00n-ui/src/event_loop.rs (1)
736-749: LGTM!n00n-lua/src/api/agent.rs (1)
148-148: LGTM!plugins/lib/n00n/route_tier.lua (1)
4-4: LGTM!n00n-ui/src/app/mouse.rs (1)
75-85: LGTM!site/docs/content/lua-api/_index.md (1)
826-826: LGTM!Also applies to: 2622-2637, 4891-4891
n00n-ui/src/chat.rs (1)
282-285: LGTM!n00n-ui/src/components/messages/mod.rs (1)
719-730: LGTM!n00n-ui/src/components/command.rs (1)
27-27: LGTM!AGENTS.md (1)
53-53: LGTM!n00n-config/src/lib.rs (1)
56-56: LGTM!Also applies to: 70-70
n00n-lua/src/loader.rs (1)
30-33: LGTM!Also applies to: 103-104, 667-675
plugins/team/retrieve.lua (1)
1-1: LGTM!plugins/team/roles.lua (1)
1-8: LGTM!plugins/team/swarm.lua (1)
39-39: LGTM!scripts/team_demo.sh (1)
2-35: LGTM!Also applies to: 58-58
n00n-lua/tests/plugin_host.rs (1)
3435-3445: LGTM!Also applies to: 3460-3462, 3477-3477
plugins/team/init.lua (1)
1-19: LGTM!Also applies to: 42-56, 66-68, 71-114, 135-138, 189-199, 215-224, 255-285, 290-335, 352-358, 386-395, 397-408, 410-423, 467-467, 482-491, 530-537, 548-552, 565-577, 622-630, 640-646, 656-662
plugins/team/mem.lua (1)
13-13: LGTM!plugins/team/quorum.lua (1)
47-47: LGTM!n00n-lua/tests/spec.rs (1)
7-7: LGTM!n00n-docgen/src/gen_tools.rs (1)
37-45: LGTM!site/docs/content/commands/_index.md (1)
16-16: LGTM!Also applies to: 34-37
site/docs/content/tools/_index.md (1)
10-10: LGTM!Also applies to: 158-214
plugins/team/ibn.lua (1)
1-16: LGTM!Also applies to: 27-36, 42-62
plugins/agent_control/init.lua (1)
1-90: LGTM!plugins/task/init.lua (1)
16-16: LGTM!Also applies to: 44-45, 81-84, 340-340
n00n-lua/tests/task_policy.rs (1)
417-439: 🩺 Stability & AvailabilityNo Lua-thread race here
exec_toolgoes through the tool request queue, and the Lua runtime handlesRequest::CallToolon its single dedicatedn00n-luathread. The three spawned OS threads only submit work; they do not enter the Lua VM concurrently.> Likely an incorrect or invalid review comment.
🛑 Comments failed to post (4)
plugins/task/init.lua (2)
151-165: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Confirm what tool audience / system prompt n00n.session.new grants by default. rg -nP -A 20 'fn new\(' n00n-lua/src/api/session.rs rg -nP 'audience' n00n-lua/src/api/session.rs n00n-lua/src/api/agent.rsRepository: w0wl0lxd/n00n
Length of output: 2393
🏁 Script executed:
#!/bin/bash set -euo pipefail echo '--- plugin excerpt ---' sed -n '130,260p' plugins/task/init.lua | cat -n echo '--- session API around new/roundtrip ---' sed -n '1,220p' n00n-lua/src/api/session.rs | cat -n echo '--- agent API around tools/session audience ---' sed -n '220,520p' n00n-lua/src/api/agent.rs | cat -n echo '--- semaphore references in plugin ---' rg -n 'semaphore:acquire|semaphore:release|output_schema|background' plugins/task/init.luaRepository: w0wl0lxd/n00n
Length of output: 29744
🏁 Script executed:
#!/bin/bash set -euo pipefail echo '--- SessionRequest::New handling ---' rg -n -A 40 -B 10 'SessionRequest::New|enum SessionRequest|match .*SessionRequest' n00n-lua/src n00n/src echo '--- schema preflight in task plugin ---' rg -n -A 30 -B 10 'Compile early|output_schema|json schema|schema' plugins/task/init.lua echo '--- semaphore around task subagent setup ---' rg -n -A 40 -B 20 'semaphore:acquire|semaphore:release|agent.session|general_sub|research_sub' plugins/task/init.luaRepository: w0wl0lxd/n00n
Length of output: 6533
Background mode should create the same subagent directly
plugins/task/init.lua:151-165starts a fresh session and asks it, in natural language, to calltaskagain withbackground=false. That makes the background path depend on model compliance instead of deterministically reusing then00n.agent.session(...)setup, so the initial spawn skips the sync path’s subagent audience, earlyoutput_schemacheck, and semaphore gating until/if the nested call happens. Use the detached subagent path directly instead.🤖 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 `@plugins/task/init.lua` around lines 151 - 165, Replace the background branch in the task handler with the same detached subagent creation flow used by the synchronous path, invoking n00n.agent.session(...) directly instead of creating a session with a natural-language prompt. Preserve the background response contract while ensuring subagent audience setup, early output_schema validation, and semaphore gating occur during the initial spawn.
277-297: 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Inspect get_progress and gather implementations for yield/backoff behavior. rg -nP -B2 -A 20 'fn get_progress' n00n-lua/src rg -nP -B2 -A 20 'fn gather' n00n-lua/srcRepository: w0wl0lxd/n00n
Length of output: 8706
🏁 Script executed:
#!/bin/bash set -euo pipefail echo '--- plugins/task/init.lua around reported lines ---' cat -n plugins/task/init.lua | sed -n '240,320p' echo echo '--- search for results[2] / do_poll / gather in plugin ---' rg -n "results\[2\]|do_poll|gather\(" plugins/task/init.lua plugins/task -S echo echo '--- inspect get_progress timeout constant ---' rg -n "PROGRESS_TIMEOUT_MS|get_progress" n00n-lua/src/api/agent.rs -n -A4 -B4Repository: w0wl0lxd/n00n
Length of output: 5415
🏁 Script executed:
#!/bin/bash set -euo pipefail echo '--- locate preview:update implementation ---' rg -n "function .*update|:update\(" plugins/task/init.lua -n -A4 -B4 echo echo '--- inspect task plugin preview object definition ---' ast-grep outline plugins/task/init.lua --view expanded echo echo '--- search for n00n.async.gather return handling in repo ---' rg -n "local results = n00n\.async\.gather|results\[[12]\]\.ok" plugins n00n-lua -SRepository: w0wl0lxd/n00n
Length of output: 1461
🏁 Script executed:
#!/bin/bash set -euo pipefail echo '--- get_progress / session-close behavior ---' rg -n "session closed|get_progress|closed" n00n-lua/src/api/agent.rs -n -A6 -B6 echo echo '--- do_prompt / preview.update surrounding code ---' cat -n plugins/task/init.lua | sed -n '100,160p' cat -n plugins/task/init.lua | sed -n '240,300p'Repository: w0wl0lxd/n00n
Length of output: 9154
Propagate the poll coroutine result
get_progress()already waits, so this won’t busy-spin. The remaining issue is thatresults[2]is ignored: ifdo_pollerrors,gatherrecords it and the task still succeeds viaresults[1]. If polling is best-effort, log it; otherwise surface the error too.🤖 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 `@plugins/task/init.lua` around lines 277 - 297, Handle the result of the do_poll coroutine after n00n.async.gather, rather than ignoring results[2]. If polling failures are not best-effort, propagate results[2].err so the task fails; otherwise explicitly log the polling error while preserving the existing prompt result handling.plugins/team/ibn.lua (1)
17-25: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use word boundaries to avoid false positive substring matches.
The
is_multi_stepfunction uses plain substring matching (g:find(sig, 1, true)). This will mistakenly match common substrings (e.g.,"and"inside "standard" or "random","test"inside "latest"), causing the heuristic to incorrectly identify single-step goals as multi-step. This incorrectly bypasses the beta fan-out gate optimization for strong models.Use Lua's frontier pattern
%f[%a]to ensure the keyword is matched as a whole word.🐛 Proposed fix
local function is_multi_step(goal) local g = (goal or ""):lower() for _, sig in ipairs(MULTI_STEP) do - if g:find(sig, 1, true) then + if g:find("%f[%a]" .. sig .. "%f[%A]") then return true end end return false end📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.local function is_multi_step(goal) local g = (goal or ""):lower() for _, sig in ipairs(MULTI_STEP) do if g:find("%f[%a]" .. sig .. "%f[%A]") then return true end end return false end🤖 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 `@plugins/team/ibn.lua` around lines 17 - 25, Update is_multi_step to match each MULTI_STEP keyword only at a word boundary using Lua’s frontier pattern %f[%a], while preserving case normalization and literal matching so substrings within larger words no longer trigger a multi-step result.plugins/team/init.lua (1)
396-396: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Rename unused argument
inputto_input.Static analysis detected an unused argument
input. To comply with Lua conventions and prevent warnings, prefix it with an underscore.♻️ Proposed refactor
-finish_run = function(ctx, input, results, total_cost, completed, unit, slug, failures) +finish_run = function(ctx, _input, results, total_cost, completed, unit, slug, failures) local report = table.concat(results, "\n\n")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.finish_run = function(ctx, _input, results, total_cost, completed, unit, slug, failures) local report = table.concat(results, "\n\n")🧰 Tools
🪛 Luacheck (1.2.0)
[warning] 396-396: unused argument 'input'
(W212)
🤖 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 `@plugins/team/init.lua` at line 396, Rename the unused input parameter in the finish_run function to _input, preserving its position and all other parameters and behavior.Source: Linters/SAST tools
Summary
task,almas, and the newagent_controltool available togetherthinking...indicator; reasoning remains in expandable chat disclosureshandler returned nil without calling ctx:finish()background=trueto task and ALMAS, returning anagent_idagent_controlactions to list, inspect, steer, and stop background agentsVerification
nix develop -c cargo nextest run -p n00n-lua -p n00n-ui -p n00n-config— 1961 passednix develop -c cargo clippy -p n00n-lua -p n00n-ui -p n00n-config --all-targets -- -D warningsnix develop -c just gen-docsagent_control,almas, andtaskcoexist