Skip to content

fix(server): keep exec in HashMap during output streaming for TTY sessions#392

Merged
DorianZheng merged 1 commit into
mainfrom
fix/server-exec-tty-pipeline
Mar 18, 2026
Merged

fix(server): keep exec in HashMap during output streaming for TTY sessions#392
DorianZheng merged 1 commit into
mainfrom
fix/server-exec-tty-pipeline

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • Fixed interactive TTY exec sessions: stream_output was removing the execution from the executions HashMap, making all subsequent send_input, send_signal, and resize_tty calls fail with "execution not found". Now clones the execution instead and defers cleanup to after process exit.
  • Added coordinator REST API integration tests: 12 tests covering worker registration, heartbeat, removal, OAuth, config, metrics, Swagger UI, and error cases.
  • Added boxlite-server to make targets: Change detection (make/changes.mk), test (make test:unit:server), and inclusion in test:unit:rust.

Test plan

  • cargo test -p boxlite-server — 25 tests pass (13 unit + 12 integration)
  • cargo clippy -p boxlite-server --tests -- -D warnings — clean
  • make test:unit:server — works
  • Manual test: start boxlite-server, exec /bin/sh with TTY, verify interactive I/O works

…sions

stream_output was removing the execution from the HashMap, making all
subsequent send_input, send_signal, and resize_tty calls fail with
"execution not found". This broke interactive TTY sessions entirely.

Fix: clone the execution instead of removing it, and defer cleanup to
after the process exits. Also adds coordinator REST API integration
tests and includes boxlite-server in make test/fmt/lint targets.
@DorianZheng DorianZheng merged commit 8dff62a into main Mar 18, 2026
17 checks passed
@DorianZheng DorianZheng deleted the fix/server-exec-tty-pipeline branch March 18, 2026 03:09
DorianZheng added a commit that referenced this pull request Mar 18, 2026
…ml (#392)

Make the coordinator's utoipa-generated OpenAPI spec fully match the
hand-written spec at openapi/rest-sandbox-open-api.yaml.

- Extract wire types into handlers/types.rs with ToSchema derives for
  all 30 OpenAPI schemas (Box, ExecRequest, Snapshot, ImageInfo, etc.)
- Add #[utoipa::path] annotations to all 16 existing proxy handlers
- Add 17 stub handlers (501) for unimplemented endpoints (snapshots,
  clone, export, import, files, images, TTY WebSocket)
- Implement get_box_metrics via existing gRPC GetMetrics
- Register all paths, schemas, tags, and security schemes in ApiDoc
- Add SecuritySchemeAddon for BearerAuth + OAuth2 client credentials
- Rename path parameter namespace → prefix to match spec
- Add OpenAPI conformance test suite (6 structural tests)
- Add comprehensive unit tests for types serde (37), error helpers (9),
  proto conversion (3), and integration tests (32)
DorianZheng added a commit that referenced this pull request Mar 18, 2026
…ml (#394)

* feat(server): align utoipa OpenAPI spec with rest-sandbox-open-api.yaml (#392)

Make the coordinator's utoipa-generated OpenAPI spec fully match the
hand-written spec at openapi/rest-sandbox-open-api.yaml.

- Extract wire types into handlers/types.rs with ToSchema derives for
  all 30 OpenAPI schemas (Box, ExecRequest, Snapshot, ImageInfo, etc.)
- Add #[utoipa::path] annotations to all 16 existing proxy handlers
- Add 17 stub handlers (501) for unimplemented endpoints (snapshots,
  clone, export, import, files, images, TTY WebSocket)
- Implement get_box_metrics via existing gRPC GetMetrics
- Register all paths, schemas, tags, and security schemes in ApiDoc
- Add SecuritySchemeAddon for BearerAuth + OAuth2 client credentials
- Rename path parameter namespace → prefix to match spec
- Add OpenAPI conformance test suite (6 structural tests)
- Add comprehensive unit tests for types serde (37), error helpers (9),
  proto conversion (3), and integration tests (32)

* fix(make): narrow Cargo.lock change detection to avoid unnecessary tests

Cargo.toml and Cargo.lock changes previously triggered tests for ALL
Rust components (rust cli ffi server). This caused the pre-push hook
to run CLI VM integration tests for unrelated changes like adding a
dev-dependency to boxlite-server.

Now: workspace-root Cargo.toml and Cargo.lock only trigger the `rust`
base component. Per-crate Cargo.toml changes are already detected by
the directory-prefix rules (e.g., boxlite-server/Cargo.toml matches
the ^boxlite-server/ rule which emits `server`).
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