Repository navigation
feat(resources): complete Resources tab and Agents pane - #24
Conversation
Network sparklines now plot each direction as a percentage of a rolling peak sampled from the selected interface, so small transfers stay visible instead of flatlining against a fixed scale. A sync flag lets the download and upload axes share a common maximum when configured. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The zeroing shortcut now falls back to the default interface when none is explicitly selected, and records that choice so subsequent zeroing targets the same interface. A test covers the network panel rendering at desktop and narrow widths. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the network resource sampling and panel drawing code, along with their tests, to match rustfmt's line-wrapping rules. No behaviour changed. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Read /sys/class/net/<iface>/flags and test the IFF_UP bit instead of comparing operstate to "up", since operstate can report "unknown" on interfaces that are actually up. Also add coverage for zeroing network totals and cycling interfaces, which now skip down links. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Network samples are now sorted by interface name so the panel order stays stable between refreshes, and an empty configured interface name is treated as unset instead of being passed through. The test module also imports the network panel draw helper it needs. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The network panel now derives its "Top" rate from the selected interface's history instead of the current download/upload values, and the sparkline series swap received and transmitted rates when the swap upload/download option is enabled. Previously the panel ignored the swap setting and could report a top rate belonging to a different interface. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The narrow network panel now includes the selected interface name alongside the download and upload rates, so the panel stays informative when horizontal space is tight. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The Net tab header now displays the active interface and its first IP address, falling back to the default interface when none is selected, so the current target is visible without opening the panel. Hit regions were shifted to match the wider title, and the net panel gained a bit-rate line alongside the existing byte-rate line. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the network title bar code to satisfy rustfmt line width limits, splitting long call chains and argument lists across multiple lines. No behaviour change. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test that draws the resources panel and clicks the auto and sync controls, asserting each toggles its flag. This guards the hit regions for those controls against regressions. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The above/below streak counters now decay instead of resetting when a sample is neither high nor low, so a single neutral reading no longer discards accumulated evidence and the scale stops oscillating. The default interface picker also selects the busiest interface rather than the first match, and a test covers the counter behaviour. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Silence the clippy too-many-arguments warning on the network panel draw helper and let rustfmt reflow the default interface selection and its signature. The network zeroing test now selects an interface up front so it exercises the same path as the UI. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test asserting that the network resource options deserialize from camelCase keys and that configs omitting them fall back to the expected defaults. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The sampler tested bit 0 of the interface flags, which reports whether the interface is up administratively rather than whether it has carrier. It now tests bit 0x40 (IFF_RUNNING) so the reported link state reflects an actually operational interface. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The auto-scaled network graph ceiling is now floored to whole bytes so the axis maximum stays a stable integer instead of drifting with fractional averages. The sampler indentation fix is cosmetic. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The click test asserted the wrong initial and post-click states for the network auto toggle, so it passed only because the expectations were reversed. The assertions now match the actual toggle behaviour. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the network resource test to feed a later snapshot whose wlan0 totals have grown and assert the rendered view shows the delta since the counters were zeroed. This guards the offset behaviour against regressions. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Network snapshots now carry a connected flag alongside the administrative up state, derived from Linux interface flags and observed traffic. On Linux the interface flags are read through a shared helper that distinguishes administratively up from running, while other platforms fall back to treating an assigned address as configured and traffic as evidence of connection. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Network zero offsets are now stored per interface instead of as a single pair, so switching between interfaces no longer resets the totals against the wrong baseline. The top rate display also reports receive and transmit peaks separately rather than a single combined maximum. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The Linux interface flag decoding is now a named helper that returns the admin-up and running bits, so the sampler and its test share one implementation instead of duplicating the bit masks. The remaining edits are formatting only. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test no longer asserts that pressing z is handled, since that key binding is gone. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the network panel rendering test to check that the directional receive/transmit peak summary appears at the widest layout, guarding the formatting of that row against regressions. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The network panel now applies the swap_upload_download setting to the top and total rate figures, so the displayed directions match the configured labels instead of always showing receive first. Default interface selection was also simplified to pick the first up, non-loopback interface with traffic rather than the busiest one. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The default interface lookup used filter, which returned an iterator rather than a single interface, so the function could not yield the expected result. Switching to find returns the first matching active, non-loopback interface as intended. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The linux_interface_state helper was gated to target_os = "linux", so it was unavailable when running tests on other platforms. The cfg now also includes test, allowing the helper to be exercised everywhere. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
feat(resources): add network rates panel and autoscaling
Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a public agents module to the monitor crate so the new agent registry and its tests are reachable from outside the crate. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a registry for tracking agent state within the monitor crate. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Provider runs now carry the originating task id through RunTaskOptions and RunSpec so downstream consumers can correlate a run with its task frame. A new agents registry module exposes registered_roots, backed by the medulla-monitor dependency. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The resources proof now stops its harness session once the real session row has been asserted and waits for the workflow to settle, accepting either outcome, so the CPU sample is not skewed by an unrelated model turn or failure-review task. It also asserts that failure review is not active before measuring. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The process CPU sampling fixture now sleeps for two sampler intervals before collecting ticks, letting the sampler settle so the first sample is not skewed by startup work. The sorted per-tick samples are also printed to make failures easier to diagnose. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The resources coordination test now only injects the acp daemon transport environment when the harness under test is codex, leaving other harnesses with an empty value. This keeps the generated app script valid for harnesses that do not use the acp transport. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Keep the Resources view alive while minimizing unrelated terminal repaint work during the sampler CPU measurement, since every panel's production behavior has already been asserted above. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the sleep child process spawn into a multi-line chain to match the surrounding style. No behaviour change. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The App struct no longer carries the resource and session monitor samplers, since the status line now reads the injected resource snapshot instead. Tests were updated to seed that snapshot through the public setter and to import DetectedProvider from its canonical module. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the snapshot construction in the status line render test so the struct literal is built inline instead of across nested lines. The test behaviour is unchanged. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Restructure the status line test to construct the sampler snapshot as a mutable local before passing it to set_resource_snapshot, avoiding the nested struct literal inside the Arc::new call. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewVerdict: Incomplete · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): feat(resources): complete Resources tab and Agents pane. Tiny Sweeper completed its review; deterministic results follow. Unreviewed paths
Partial review reasons
Review snapshot
Completeness: Incomplete What changedAdds a `[resources]` configuration section (crates/medulla-core/src/config/resources/types.rs) with camelCase keys and an interval clamped to 100–10000 ms, wired into `TuiConfig` (crates/medulla-core/src/config/types/document.rs), and extends `clear_setting` to handle JSON-format files (crates/medulla-core/src/config/persist.rs). Introduces a shared sampler in medulla-monitor (crates/medulla-monitor/src/sampler/mod.rs) publishing `Arc<ResourceSnapshot>` from the event loop (crates/medulla-tui/src/event_loop/mod.rs), with Linux /proc CPU sampling (crates/medulla-monitor/src/cpu.rs) and sampler gating to screens that consume readings. Adds agent classification (crates/medulla-core/src/resources/agents/classify.rs) and a process-wide registry with start-time-guarded identities and generation-checked handles (crates/medulla-monitor/src/agents/registry.rs), and registers children at ACP, headless provider, interactive session, wrapper stdio, PTY, and codex app-server launch paths. Adds the Resources tab with layout, keys, plot widgets, and theme gradients (crates/medulla-tui/src/ui/app/resources/mod.rs, crates/medulla-tui/src/ui/plot/mod.rs, crates/medulla-tui/src/ui/theme/gradient.rs), a Settings › Resources editor (crates/medulla-tui/src/ui/app/settings_edit/resources.rs), and an Agents pane with sort/filter/follow/detail and confirmed signals (crates/medulla-tui/src/ui/app/render/resources/agents.rs). Extends the remote protocol with optional `usage` on session rows and `SessionsChunk` (crates/medulla-core/src/protocol/remote/types.rs), client-side atomic chunk assembly (crates/medulla-tui/src/remote/client/mod.rs), and server-side datagram-bounded chunking (crates/medulla-tui/src/remote/serve/mod.rs). Features
Tests
FindingsNo active actionable findings. Before merge
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reached
This review includes 133 billable files and costs up to $33.25. View limit details
Comment |
Add a Linux-only test asserting that should_refresh_task_details returns true for agent executables and node processes carrying an ACP agent argument, and false for unrelated processes such as sleep. This pins the gating logic so thread details are only collected for processes that can actually be agents. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Task details are now refreshed only for processes that look like coding agents, such as claude, codex, opencode, and their node or npx wrappers, instead of for every process on the system. This keeps the sampler from paying the cost of enumerating tasks for unrelated processes. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the process filter in the system resource source so the closure body fits on a single line. No behaviour change. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The sweep test now names its runs after the test itself instead of the generic run-a and run-b, so failures point at the case that produced them rather than at an ambiguous identifier. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add the captured end-to-end run log for the opencode CI job so the output is available for inspection. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Capture the full CI output from the docker, tmux, and opencode end-to-end job so the run can be inspected without re-executing the workflow. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a linux-only test asserting that may_be_agent_process accepts known agent runtimes like claude, node and bash while rejecting unrelated processes such as sleep and postgres. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
On Linux the sampler now refreshes executable and command line only for processes whose names look like agents or their shells, instead of for every process on the system. This cuts the per-sample cost of the extra refresh while still giving classification the argv it needs, and the tests were updated to cover the narrowed behaviour. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Delete the accidentally committed e2e opencode CI log and adjust the sampler module and its tests accordingly. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a Linux-only test asserting that pids_in_process_trees returns an agent process together with its descendants while leaving unrelated process trees untouched. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
On Linux, process metrics are now collected only for the agent's process tree plus the monitor itself, instead of refreshing cpu, memory and disk usage for every process on the system. This cuts the cost of each sample while keeping metrics for the processes that matter, and non-Linux targets keep refreshing all processes as before. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Restructure the Linux process metric PID collection into a single block expression and reindent the process snapshot construction. No behaviour change; the change only improves readability and formatting. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Shell processes were being treated as agent roots, which pulled every child of a shell into the process metric set. A dedicated predicate now skips common shells when selecting tree roots while still refreshing their own task details, and an empty root list short-circuits the tree walk. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The stale socket test now captures the result of prepare_bind and includes the path and error in the assertion message, so a failure shows why reaping failed instead of only that it did. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ertion Move the detailed failure message from the plain bind test to the stale socket reaping test, where a failure is more likely to need the extra context. The plain bind test now uses a bare is_ok assertion. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Summary
Complete the Resources tab epic with shared background sampling, btop-style CPU/memory/disk/network panels, and an Agents pane that attributes local and remote coding-agent processes to sessions, tasks, or external origins. This rollup also includes the Resources configuration and GitBook guide.
Issue #16 adds the live tmux E2E proof for all three harnesses, verifies external-agent attribution and panel controls, and measures sampler CPU with 1,000 processes. The sampler now requests executable and command metadata required to classify unregistered agents; bare
codexprocesses are recognized as well.Sub-issues and implementation PRs
All sub-issues were implemented on
senamakel/medulla:epic/15-resources:9e9e528c18a00612efc954c9759f60debaf5d7baVerification
make ci— passed (format, Clippy, locked tests, locked all-target build)make e2e-docker-all E2E_IMAGE=medulla-e2e:latest— passed for OpenCode, Claude, and CodexCloses #15
Closes senamakel#16