feat: add persistent worker supervision - #14
Merged
Merged
Conversation
Every child run now gets a stable run id plus its task description, forwarded with each progress event. Completed, failed, and cancelled runs append one bounded agent_run record (answer, prompt, per-tool summaries with caps and truncation markers) to the parent session, with a tombstone-aware reader. Direct @agent exchanges persist as activity without entering model history.
The TUI now keeps child-run activity out of the scrollback and in a compact roster above the composer: per-run number, agent, task description, status and current action, four rows plus +N more. /runs (picker or number/id) opens a live detail panel with the tool trail and answer; Escape closes it, draft and approvals untouched. A finished run leaves one attributed summary line. Tool output is now scannable: successful results render as ✔ name · first line (+N lines), failures keep a labelled head of up to ten lines, and every action line keeps the live ctx/ segment. Completed streamed answers are rendered as Markdown; the task tool reports its run id so the roster pairs a finished run with its answer.
FormattedTextControl hashes its fragments when caching content; Rich Text objects are unhashable, so the first render with a live subagent raised 'cannot use tuple as a dict key'. Convert the roster/detail rows to ANSI through the console, like the statusline toolbar, and add a render-level regression test.
# Conflicts: # src/lecode/agent/runner.py # src/lecode/tui/app.py # tests/test_agent_runner.py
# Conflicts: # src/lecode/tui/app.py # src/lecode/tui/feed.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
uv run ruff checkuv run ruff format --checkuv run python -m pytest -q(1,690 passed)