Skip to content

feat(tui): show streaming output progress - #930

Open
huangzesen wants to merge 3 commits into
mainfrom
dev1/stream-progress-ram-tui-20260826
Open

feat(tui): show streaming output progress#930
huangzesen wants to merge 3 commits into
mainfrom
dev1/stream-progress-ram-tui-20260826

Conversation

@huangzesen

@huangzesen huangzesen commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • consume the kernel-owned lingtai.stream-progress/v1 RAM snapshot over read-only loopback discovery
  • show factual progress beside the visible recipient's Active N s: exact chars below 1000, one-decimal k chars at or above 1000, plus delay D.Ds snapshot freshness
  • keep all network I/O in asynchronous Bubble Tea commands; View() reads cached RAM state only
  • gate results by activation generation, visible Main/direct recipient identity, lifecycle, monotonic request serial, and snapshot activity
  • reject unknown/text/duplicate/trailing/oversized payloads, identity mismatches, redirects, and non-loopback behavior
  • remove the retired manifest.streaming field from generated/example configs and /kanban; the kernel System resolver now owns the switch

Dependency

Requires the kernel API in Lingtai-AI/lingtai-kernel#1518.

Contract

  • no progress state or output text is written to/read from the filesystem
  • no partial output text is rendered
  • the TUI is the first read-only consumer, not the owner
  • a restarted TUI deterministically reattaches to a living agent
  • inactive, unavailable, stale, wrong-recipient, and out-of-order results clear or no-op safely

Amendment — init no longer owns streaming

  • GenerateInitJSON, canonical/example templates, and the playground writer emit no manifest.streaming key
  • /kanban no longer shows an init-derived streaming row; the TUI adds no System-setting editor
  • paired kernel ownership is valid LINGTAI_STREAMING_ENABLED > optional boolean settings/system.json.streaming > on
  • the loopback reader, strict seven-field parser, async polling, and recipient/generation guards are unchanged; the badge now shows factual chars plus max(now - updated_unix_ms, 0) freshness with no token conversion

Behavior change / migration

Earlier TUI templates emitted manifest.streaming: false. The paired kernel now retires and ignores that field with its existing unknown-field warning/Nudge path and performs no migration or init rewrite. Those agents stream by default after upgrade unless the operator sets LINGTAI_STREAMING_ENABLED=0 (or another valid false form) or "streaming": false in strict settings/system.json; remove the stale init key to clear the warning.

Validation

  • exact head 997aa3e4: go test ./i18n ./internal/streamprogress ./internal/tui -count=1pass
  • focused oversize/redirect/parser and 14 stream-progress lifecycle/race tests — pass
  • exact head 997aa3e4: go build ./...pass
  • exact head 997aa3e4: go vet ./...pass
  • touched-file gofmt -l — clean
  • git diff --check — clean
  • current-main GitHub merge ref 7c02b7cd (new base fce5c882 + reviewed head 94c841bc) — go test ./i18n ./internal/streamprogress ./internal/tui, go build ./..., and go vet ./... all pass
  • Windows amd64 go test -c for internal/streamprogress and internal/tui, plus go build ./...cross-compiles (not a native runtime claim)
  • real Python publisher → Go client E2E — generation 1 active=true, 4000 chars; then the same generation active=false, 0 chars; worktree status unchanged
  • final independent frozen-diff review — PASS, no P0/P1 blockers
  • config-ownership amendment — go test for i18n, internal/preset, internal/tui, and internal/streamprogress passes; matching go vet, gofmt, and git diff --check are clean
  • paired config-ownership no-Bash frozen review (tui.diff SHA-256 75290125…) — PASS, no P0/P1 blockers
  • factual-char/freshness amendment: strict en/zh/wen JSON parsing, obsolete EstimatedTokens / chars / 4 / old i18n-key scan, gofmt, and git diff --checkclean
  • local exact-head install: both /opt/homebrew/bin/lingtai-tui and /opt/homebrew/bin/lingtai report lingtai-tui dev-pr930-997aa3e4, binary SHA-256 9af671c1…
  • exact TUI client against live kernel #1518 head 9f8e57d0: generation 93 active=true, 53 chars, snapshot freshness 7 ms (53 chars · delay 0.0s)

Whole-suite disclosure: go test ./... has one root-package architecture-document failure listing these three paths:

  • tui/internal/preset/skills/swiss-knife/reference/academic-research/reference/api-semantic-scholar-batch.md
  • tui/internal/tui/app_cpr_test.go
  • tui/internal/tui/lock_windows_test.go

A corrected exact-base temporary Git-index control at e8bf4df9 reproduces the identical failing set. Other packages passed. This PR does not claim a fully green whole suite.

Paired kernel disclosure: the focused kernel matrix is 170 passed / 2 failures reproduced on exact base. Full kernel pytest is not green evidence; it is baseline-noisy and aborts around 25% from the existing macOS WindowsPath monkeypatch contamination, with the fail-fast first failure reproduced on exact base.

Remaining platform gates — do not merge yet

  • kernel PR #1518 accepted and available
  • native Windows runtime exercise of the live Python publisher + TUI badge (cross-compilation only so far)
  • resolution/waiver of the pre-existing TUI root-package architecture-doc failure on main

Telegram: @lingtaidev1bot | Nickname: 知微

Powered by LingTai AI: https://github.com/Lingtai-AI/lingtai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant