fix(agent): route git and CI logs into TUI output panel #12

Merged
frank merged 1 commit from agent/issue-9-bug-agent-git-pipeline-output-läuft-unt into main 2026-07-12 11:14:12 +02:00
Owner

Summary

  • Git worktree/commit/push output is routed through Pipeline.Err (RunLogWriter() when --tui is active) instead of os.Stderr
  • Forge CI log messages (waiting for CI …, status updates) use the same writer in TUI mode
  • Carriage-return progress lines from git push are normalized in the run log buffer for cleaner TUI display

Test plan

  • forge agent watch --tui with --pr or --commit against a repo with a matching issue
  • Let the pipeline run through worktree prepare → push → CI wait
  • Confirm all output appears only in the right-hand TUI panel; no bleed at the bottom of the terminal
  • Quit with q — terminal should restore cleanly
  • forge agent watch without --tui — git/CI messages still go to stderr as before

Closes #9

## Summary - Git worktree/commit/push output is routed through `Pipeline.Err` (`RunLogWriter()` when `--tui` is active) instead of `os.Stderr` - Forge CI log messages (`waiting for CI …`, status updates) use the same writer in TUI mode - Carriage-return progress lines from `git push` are normalized in the run log buffer for cleaner TUI display ## Test plan - [ ] `forge agent watch --tui` with `--pr` or `--commit` against a repo with a matching issue - [ ] Let the pipeline run through worktree prepare → push → CI wait - [ ] Confirm all output appears only in the right-hand TUI panel; no bleed at the bottom of the terminal - [ ] Quit with `q` — terminal should restore cleanly - [ ] `forge agent watch` **without** `--tui` — git/CI messages still go to stderr as before Closes #9
fix(agent): route git and CI logs into TUI output panel
All checks were successful
CI / race (pull_request) Successful in 9m34s
CI / test (pull_request) Successful in 9m34s
12b1822b53
Git worktree/push progress and Forge CI messages no longer write to
os.Stderr while --tui is active; carriage-return progress lines are
normalized in the run log buffer.

Co-authored-by: Cursor <cursoragent@cursor.com>
Author
Owner

🔗 Linked to issue #9. Babysitting CI until green…

🔗 Linked to issue #9. Babysitting CI until green…
Author
Owner

forge agent finished implementation

  • Commit: fix(agent): route git and CI logs into TUI output panel
  • Pull request: #12
  • Next: waiting for CI / babysitting fixes if needed
internal/agent/gitflow.go  | 43 ++++++++++++++++++++++++++++---------------
 internal/agent/pipeline.go | 14 +++++++-------
 internal/agent/status.go   | 38 +++++++++++++++++++++++++++++++++++++-
 internal/agent/tui_test.go | 16 ++++++++++++++++
 internal/cmd/agent.go      |  5 +++++
 5 files changed, 93 insertions(+), 23 deletions(-)
Agent output (tail)
- Pipeline übergibt `p.Err` (= `RunLogWriter()` bei `--tui`)
- Bei `--tui` wird `Forge.Log` für alle Repos auf `RunLogWriter()` umgestellt (CI-Meldungen wie `waiting for CI …`)
- `RunLogWriter` normalisiert `\r`-Progress-Zeilen (z. B. `git push`) im TUI-Panel
TODO_DONE: Mit `--tui` geht **kein** Pipeline-/Git-/CI-/Watcher-Output mehr am echten Terminal vorbei
TODO_DONE: Worktree-Prepare, Push-Progress und `waiting for CI …` erscheinen nur im TUI-Output-Panel
TODO_DONE: Nach Quit/Crash hinterlässt die Session keinen „verschmierten“ Alt-Screen-Bleed (Terminal sauber restored)
TODO_DONE: Ohne `--tui` bleibt bisheriges stderr-Logging unverändert
TODO_DONE: Kurzer manueller Repro-/Fix-Hinweis in PR (Watch mit Git-Push + CI-Wait)
PR_TITLE: fix(agent): route git and CI logs into TUI output panel
PR_BODY:
## Summary
- Git worktree/commit/push output is routed through `Pipeline.Err` (`RunLogWriter()` when `--tui` is active) instead of `os.Stderr`
- Forge CI log messages (`waiting for CI …`, status updates) use the same writer in TUI mode
- Carriage-return progress lines from `git push` are normalized in the run log buffer for cleaner TUI display
## Test plan
- [ ] `forge agent watch --tui` with `--pr` or `--commit` against a repo with a matching issue
- [ ] Let the pipeline run through worktree prepare → push → CI wait
- [ ] Confirm all output appears only in the right-hand TUI panel; no bleed at the bottom of the terminal
- [ ] Quit with `q` — terminal should restore cleanly
- [ ] `forge agent watch` **without** `--tui` — git/CI messages still go to stderr as before
✅ **forge agent finished implementation** - Commit: `fix(agent): route git and CI logs into TUI output panel` - Pull request: https://repository.hildebrandt.io/frank/forgecli/pulls/12 - Next: waiting for CI / babysitting fixes if needed ``` internal/agent/gitflow.go | 43 ++++++++++++++++++++++++++++--------------- internal/agent/pipeline.go | 14 +++++++------- internal/agent/status.go | 38 +++++++++++++++++++++++++++++++++++++- internal/agent/tui_test.go | 16 ++++++++++++++++ internal/cmd/agent.go | 5 +++++ 5 files changed, 93 insertions(+), 23 deletions(-) ``` <details><summary>Agent output (tail)</summary> ``` - Pipeline übergibt `p.Err` (= `RunLogWriter()` bei `--tui`) - Bei `--tui` wird `Forge.Log` für alle Repos auf `RunLogWriter()` umgestellt (CI-Meldungen wie `waiting for CI …`) - `RunLogWriter` normalisiert `\r`-Progress-Zeilen (z. B. `git push`) im TUI-Panel TODO_DONE: Mit `--tui` geht **kein** Pipeline-/Git-/CI-/Watcher-Output mehr am echten Terminal vorbei TODO_DONE: Worktree-Prepare, Push-Progress und `waiting for CI …` erscheinen nur im TUI-Output-Panel TODO_DONE: Nach Quit/Crash hinterlässt die Session keinen „verschmierten“ Alt-Screen-Bleed (Terminal sauber restored) TODO_DONE: Ohne `--tui` bleibt bisheriges stderr-Logging unverändert TODO_DONE: Kurzer manueller Repro-/Fix-Hinweis in PR (Watch mit Git-Push + CI-Wait) PR_TITLE: fix(agent): route git and CI logs into TUI output panel PR_BODY: ## Summary - Git worktree/commit/push output is routed through `Pipeline.Err` (`RunLogWriter()` when `--tui` is active) instead of `os.Stderr` - Forge CI log messages (`waiting for CI …`, status updates) use the same writer in TUI mode - Carriage-return progress lines from `git push` are normalized in the run log buffer for cleaner TUI display ## Test plan - [ ] `forge agent watch --tui` with `--pr` or `--commit` against a repo with a matching issue - [ ] Let the pipeline run through worktree prepare → push → CI wait - [ ] Confirm all output appears only in the right-hand TUI panel; no bleed at the bottom of the terminal - [ ] Quit with `q` — terminal should restore cleanly - [ ] `forge agent watch` **without** `--tui` — git/CI messages still go to stderr as before ``` </details>
Author
Owner

☑️ ToDos checked off

  • Mit --tui geht kein Pipeline-/Git-/CI-/Watcher-Output mehr am echten Terminal vorbei
  • Worktree-Prepare, Push-Progress und waiting for CI … erscheinen nur im TUI-Output-Panel
  • Nach Quit/Crash hinterlässt die Session keinen „verschmierten“ Alt-Screen-Bleed (Terminal sauber restored)
  • Ohne --tui bleibt bisheriges stderr-Logging unverändert
  • Kurzer manueller Repro-/Fix-Hinweis in PR (Watch mit Git-Push + CI-Wait)
☑️ **ToDos checked off** - [x] Mit `--tui` geht **kein** Pipeline-/Git-/CI-/Watcher-Output mehr am echten Terminal vorbei - [x] Worktree-Prepare, Push-Progress und `waiting for CI …` erscheinen nur im TUI-Output-Panel - [x] Nach Quit/Crash hinterlässt die Session keinen „verschmierten“ Alt-Screen-Bleed (Terminal sauber restored) - [x] Ohne `--tui` bleibt bisheriges stderr-Logging unverändert - [x] Kurzer manueller Repro-/Fix-Hinweis in PR (Watch mit Git-Push + CI-Wait)
frank merged commit d11f762a36 into main 2026-07-12 11:14:12 +02:00
frank deleted branch agent/issue-9-bug-agent-git-pipeline-output-läuft-unt 2026-07-12 11:14:12 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
frank/forgecli!12
No description provided.