Commit Graph

2 Commits

Author SHA1 Message Date
Mason Daugherty c6e3b351f1 fix(code): partition Debug Console log retention by level (#4718)
Debug Console level filters now surface recent `INFO`/`WARNING`/`ERROR`
logs even when `DEBUG` output dominates the window; a `DEBUG` flood no
longer evicts higher-severity records.

---

The in-app Debug Console (`Ctrl+\`) tails an always-on in-memory ring
buffer that kept a **single** `deque` shared across every level. When
`DEBUG` logging is enabled, verbose `DEBUG` output quickly filled that
window and evicted the rarer `INFO`/`WARNING`/`ERROR` records before the
user ever picked a level filter — so selecting "INFO" turned up nothing
even though `INFO` records had been emitted this session. The filter
*matching* was correct; *retention* was discarding the records the
filter needed.

This partitions retention by level: each level keeps its own bounded
`deque`, so a burst at one level can no longer evict another. Each
retained record is tagged with its monotonic emission sequence so
snapshots stay chronologically ordered across levels, preserving the
existing `snapshot_records_since` contract (absolute resume index,
`(records, total)` shape, negative-index behavior). Non-standard level
names share one bounded fallback bucket so nothing is silently dropped.
The console's own retained copy applies the same per-level cap so it
isn't re-flattened.

As intended, the `All`/`min:*` views can now show more than the
per-level capacity in total (up to capacity per level) and interleave
older high-severity records that previously fell off the single window —
which is the point. Memory stays bounded (~capacity × number of levels).

Made by [Open
SWE](https://openswe.vercel.app/agents/da1fb4b1-3886-27df-551a-84c49759fbb6)

## References
- Plan:
https://openswe.vercel.app/agents/da1fb4b1-3886-27df-551a-84c49759fbb6/plan

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-07-14 11:17:46 -04:00
Mason Daugherty 4f94a30c11 feat(code): in-app Debug Console (#4564)
Deep Agents Code now includes an in-app Debug Console. Press `Ctrl+\` to
inspect session details and filter, view, or copy recent application
logs without enabling file-based debug logging.

---

Debugging client-side TUI problems currently requires restarting with
file logging enabled and tailing a log in another terminal. This adds an
in-app Debug Console, modeled on Mistral Vibe's console, so users can
inspect session state and recent application logs without leaving the
TUI.

Open the console with `Ctrl+\` or the hidden `/debug` command. It shows
a point-in-time snapshot of the version, model, thread, working
directory, auto-approve state, sandbox, MCP servers, token usage, and
debug-log path. Below that, it tails recent `deepagents_code.*` records
from an always-on bounded in-memory buffer and supports filtering by
severity.

The buffer captures `INFO` and above by default, or the level selected
with `DEEPAGENTS_CODE_LOG_LEVEL`. `DEEPAGENTS_CODE_DEBUG` continues to
enable append-only file logging and defaults capture to `DEBUG`.
`Ctrl+L` clears the current console view without clearing the underlying
buffer; `c` copies the visible filtered records retained since the last
clear, and clicking a record copies only that record.

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-07-13 02:48:48 -04:00