mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-07-25 02:35:23 -04:00
[PR #20] [MERGED] Bug fix #24
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/GH05TCREW/pentestagent/pull/20
Author: @giveen
Created: 1/20/2026
Status: ✅ Merged
Merged: 1/20/2026
Merged by: @GH05TCREW
Base:
main← Head:bug-fix📝 Commits (8)
0a79b5dWIP: save local edits (tui.py, .gitignore)5e6e4cdfix: heuristics for flags-only terminal commands; route semantic tools to terminalea9c69ffix(tui): append agent history when target set/restored so LLM sees changes00a7449fix(tui): ensure workspace restores supersede manual target messages6b4a568fix(tui): clear target and agent state when deactivating workspacecabae0ffeat(tui): add persistent header showing runtime/mode/target and keep it updated0219d83fix(tui): avoid mount_before AttributeError by falling back to mount9de59f1refactor(tui): use persistent header for target display; remove in-chat target duplicates📊 Changes
4 files changed (+266 additions, -38 deletions)
View changed files
📝
.gitignore(+3 -0)📝
pentestagent/agents/base_agent.py(+47 -1)📝
pentestagent/interface/tui.py(+154 -37)📝
pentestagent/tools/terminal/__init__.py(+62 -0)📄 Description
Summary:
Fixes runtime and UX bugs that prevented tool execution and caused inconsistent target selection in the TUI. Improves robustness across Textual versions and makes the target visible and authoritative to the LLM.
What was broken:
What I changed (key files):
Rationale:
Textual workers are Worker objects; scheduling them as coroutines caused runtime errors. Handling Worker objects correctly preserves Textual semantics. LLMs sometimes emit partial or semantic commands; best-effort normalization reduces shell failures and improves task success. The LLM relies on conversation history for state (target): explicit system messages and deterministic workspace restores ensure the LLM uses the intended target. A persistent header provides immediate operator context and avoids losing the active target when the chat scrolls.
Testing performed:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.