fix(tui_gateway): add /goal wait and /goal unwait command parity - #50869
Open
srojk34 wants to merge 2 commits into
Open
fix(tui_gateway): add /goal wait and /goal unwait command parity#50869srojk34 wants to merge 2 commits into
srojk34 wants to merge 2 commits into
Conversation
The /goal wait <pid> barrier (ff85af3) was wired into the CLI (cli_commands_mixin.py) and gateway (slash_commands.py) but the TUI gateway's /goal dispatcher was not updated. Typing /goal wait <pid> in the TUI fell through to the default branch and silently created a new goal named "wait <pid>" instead of parking the loop. Add the same wait/unwait parsing to tui_gateway/server.py, using the existing GoalManager.wait_on() and stop_waiting() methods and the TUI's _ok(rid, {type: exec, output: ...}) response convention.
Six cases: valid pid with reason, bare /goal wait (usage hint), non-integer pid (error), RuntimeError from GoalManager (no active goal), /goal unwait with barrier (cleared), /goal unwait without barrier (no-op message).
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the TUI wait-barrier parity gap. The premise remains valid on current main: tui_gateway/server.py:12160-12164 still treats unrecognized /goal input as a new goal, while the messaging gateway already implements wait/unwait at gateway/slash_commands.py:2238-2260.
Problems
tui_gateway/server.py:9040in this PR slices the untrimmedarg, although the branch predicate usesarg.strip().lower()(current main:tui_gateway/server.py:12128). A direct RPC request witharg=" wait 123"matches the wait branch but produces"t 123", causing a false invalid-PID response.
Suggested changes
- Normalize the argument once and use that normalized value for wait parsing; add a whitespace-prefixed wait case in the current focused suite,
tests/tui_gateway/test_goal_command.py.
Automated hermes-sweeper review.
| ) | ||
|
|
||
| # /goal wait <pid> [reason] — park the loop on a background process. | ||
| if lower == "wait" or lower.startswith("wait "): |
Contributor
There was a problem hiding this comment.
lower was derived from arg.strip(), but this slices the untrimmed arg. A direct command.dispatch request with arg=" wait 123" matches the wait branch yet turns into "t 123". Slice arg.strip() (or a precomputed normalized argument) and add coverage.
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
/goal wait <pid>and/goal unwaitwere added to both the CLI (cli_commands_mixin.py) and gateway (slash_commands.py) in feat(goals): /goal wait <pid> — park the loop on a background process #50503, but the TUI gateway's/goaldispatcher was not updated./goal wait 1234falls through to the default "set new goal" branch and silently creates a goal named"wait 1234"instead of parking the loop on PID 1234./goal unwaitsimilarly creates a goal named"unwait".Fix
Add the same
wait/unwaitsubcommand parsing totui_gateway/server.py, using the existingGoalManager.wait_on()andstop_waiting()methods and the TUI handler's_ok(rid, {type: exec, output: ...})response convention. Logic mirrorsgateway/slash_commands.pyline-for-line.Test plan
/goal build the project)/goal wait <pid>with a valid PID — verify "⏳ Goal parked" output/goal waitwith no argument — verify usage hint/goal wait abc— verify " must be an integer" error/goal unwait— verify "▶ Wait barrier cleared" output/goal unwaitwith no barrier set — verify "No wait barrier set" output/goal status,/goal pause,/goal resume,/goal clear