Serve /static from embedded assets when no static path override is configured, add static route coverage, and update Docker/docs to reflect embedded-by-default behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Relax screenshot request gating to depend on tab visibility only, so thumbnail updates continue when the dashboard tab is visible but the window is not focused.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Emit dashboard activity updates only when terminal screen content actually changes, and tighten screenshot 304 fast-path behavior to avoid stale not-modified responses after newer activity.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore reliable live thumbnail updates in the single-flight queue and set UTF-8 charset metadata/headers so typeahead hint symbols render correctly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reduce per-route SSE activity event frequency by doubling the server-side debounce window from 250ms to 500ms.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure only one screenshot request is in flight at a time, queue per-tile refreshes, and pause screenshot fetches while the dashboard is hidden or unfocused.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore dashboard typeahead behavior to match the Python version with floating results, keyboard navigation, tile highlighting, and Enter-to-open handling.
Add HTTP gzip compression middleware (while excluding WebSocket upgrades) to reduce SVG transfer size, and add a safe make push target that pushes current branch plus tags on HEAD.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Introduce VERSION as the app version source of truth and add make bump-patch to increment VERSION, commit, and create a matching vX.Y.Z tag.
Wire VERSION into build outputs by injecting it into webterm.Version for make build-go and Docker image builds, and include VERSION in Docker build context.
Also remove the visible dashboard container count subtitle while keeping count updates in browser console logs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure SessionManager.CloseAll fully removes session and route mappings by reusing CloseSession for each tracked session ID.
Tighten coverage test assertions to verify CloseAll removes both sessions and route-key mappings, guarding against stale state regressions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rationalize the release workflow by adding top-level concurrency to avoid overlapping publish runs for the same ref and by restricting cleanup jobs to tag refs only.
Keep ci.yml as the PR/main validation gate while docker.yml remains focused on release publishing and post-release maintenance.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Audit findings: cmd/webterm and webterm package were acceptable, but terminalstate
was an internal implementation detail exposed as a public package.
Changes:
- Move go/terminalstate -> go/internal/terminalstate
- Update imports to github.com/rcarmo/webterm-go-port/internal/terminalstate
- Keep package name terminalstate unchanged
Resulting package layout:
- github.com/rcarmo/webterm-go-port/cmd/webterm
- github.com/rcarmo/webterm-go-port/internal/terminalstate
- github.com/rcarmo/webterm-go-port/webterm
Validation:
- go test ./...
- go test -race ./...
- go coverage check remains 80.9%
- make check
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add comprehensive runtime tests for session, docker watcher/stats/http, and server helpers
- Add new fuzz targets: FuzzToIntFromQuery and FuzzHTMLHelpers
- Add cmd/webterm main entrypoint test
- Expand helper conversion and color-mode coverage tests
Validation:
- go test ./...
- go test -race ./...
- All 15 fuzz targets pass with short fuzz runs
- go test ./... -coverpkg=./... => 80.9% total statement coverage
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add relevant skeleton files from rcarmo/agentbox/skel for this repo:
- .github/workflows/ci.yml (Makefile checks + conditional Go tests)
- .github/instructions/{00-project-detection,docker-image,frontend-bun,go,python}.instructions.md
Instruction files were adapted where needed to match current workflow names
and repository layout (Go module under go/, Docker workflow filename).
Validated with make check and go test ./... .
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
go-te v0.1.0 fixes the ByteStream C1 bug (Latin-1 fallback for
invalid UTF-8 bytes), so NormalizeC1Controls is no longer needed.
Removed:
- NormalizeC1Controls function and its tests/fuzz target
- utf8Buffer field from TerminalSession and DockerExecSession
- C1BUG.md (fix shipped upstream)
The handleOutput pipeline now does: FilterDA → replay → tracker → connector
(was: FilterDA → NormalizeC1 → replay → tracker → connector)
All tests pass with -race. 13 fuzz targets remain.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ByteStream.Feed() in UTF-8 mode permanently stalls on raw C1
control bytes (0x80-0x9F). DecodeRune returns RuneError, the loop
breaks, and the bad byte stays in the buffer forever — blocking
all subsequent input and leaking memory.
Stream.handleGround() has correct C1 handlers but they are
unreachable through ByteStream. Includes reproduction case and
suggested fix (Latin-1 fallback for invalid UTF-8 bytes).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Full Go implementation under go/ replacing Python pyte with go-te:
- HTTP server with WebSocket protocol, SSE, screenshot SVG rendering
- PTY terminal sessions and Docker exec sessions
- Docker watcher (label-based container discovery + event stream)
- CPU stats collection with sparkline SVG rendering
- Session manager with TwoWayMap routing and replay buffers
- C1 normalization, DA filtering, identity generation, theme palettes
Audit fixes for 9 concurrency/correctness issues:
- HTTP transport leak: shared client pool for Docker socket calls
- WebSocket concurrent writes: all writes routed through send channel
- Closed channel panic: atomic.Bool guard on enqueueWSData
- GetFirstRunningSession: use UnsafeForward under SessionManager lock
- NewSession TOCTOU: re-check routeKey after re-acquiring lock
- waitErr data race: protect with mutex in both session types
- Replay buffer fragmentation: copy to new slice on eviction
- go-te dirty tracking: check screen.Dirty before incrementing counter
- Identity modulo bias: rejection sampling for uniform distribution
All Go tests pass (including -race). Python baseline unchanged (397 tests).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pyte 0.8.2 does not handle CSI S (SU — Scroll Up) or CSI T (SD —
Scroll Down). When TERM=xterm-256color, tmux sends CSI n S for bulk
scrolling instead of DECSTBM+index. pyte silently ignored these
sequences, leaving old content in the screen buffer — visible as
ghost content in SVG screenshots.
Fix: monkeypatch pyte's CSI dispatch tables to map S→scroll_up and
T→scroll_down, and implement both methods on AltScreen with proper
scroll-region (DECSTBM) support.
Adds 6 tests for SU/SD functionality.
Ink (React CLI framework) clears its output using repeated EL2+CUU1
sequences, one per previously-drawn line. When /clear resets Ink's
internal line counter, the next frame only erases a few lines instead
of the full previous output. In a real terminal the old content is in
scrollback and invisible, but pyte's fixed-size screen retains it,
producing ghost content (e.g. duplicated prompts) in SVG screenshots.
Added AltScreen.expand_clear_sequences() which detects runs of 3+
EL2+CUU1 pairs that don't reach row 0 and extends them to erase all
lines up to the top of the screen. Both DockerExecSession and
TerminalSession call this before feeding data to pyte.
Also made on_session_end() idempotent (contextlib.suppress KeyError)
to prevent a race when close_session() and natural session exit both
call it.
Added docs/ink-clear-fix.md with root cause analysis, byte-level
explanation, and reproduction script.
- close_session() now calls on_session_end() to remove the session from
sessions dict and routes, preventing zombie entries that persist after
the container is gone
- _remove_container() now closes the active session before removing the
app from apps_by_slug/apps, so session cleanup can still reference the
app during teardown
- Updated and added tests to verify session tracking cleanup
- handle DECSET ?47 as an alternate screen mode so tmux clear redraws don't overlay stale content in screenshots
- keep AltScreen mode checks aligned with 47/1047/1048/1049 variants used by full-screen TUIs
- document the screenshot debugging workflow in .github/skills/screenshot-debugging/SKILL.md for repeatable escape-sequence analysis