Repository navigation
feat(websh): announce idle-warning and name an idle detach - #675
Conversation
Show a local-time warning on stderr before an idle close, ignore invalid or repeated warning deadlines, and explain how to reopen a session closed for inactivity.
There was a problem hiding this comment.
🟢 Approved
The review status indicates that no active issues remain for the change.
No open issues 🎉
What changed in this PR
This pull request adds idle-timeout warnings for Websh sessions and updates the inactivity close message.
Changes:
- Displays validated idle deadlines on stderr in the user’s local time.
- Deduplicates warnings across reconnects without changing replay offsets.
- Updates the
idle_timeoutclose message. - Adds focused coverage for warning validation, output, replay behavior, and reconnects.
This pull request requires changes.
| File | Summary |
|---|---|
api/websh/websh.go |
Handles idle-warning frames, validation, local-time formatting, deduplication, and the updated close message. Moderate: prune expired deadlines or otherwise bound retained warning history. |
api/websh/websh_test.go |
Updates expectations for the inactivity close message. |
api/websh/types.go |
Stores idle-warning deadlines across connections. |
api/websh/idle_warning_test.go |
Tests warning output, validation, replay preservation, and reconnect deduplication. |
Review effort: Lite
Fixed in 8e03c87. Validation passed: vet, the full race suite, formatting, and lint. The first race run hit an event-listener timing assertion while lint was running; the full rerun without the linter passed. Resolved this review-body finding with a regression test; reverting 8e03c87 restores the previous history retention behavior. |
There was a problem hiding this comment.
WALL-D review: Approval withheld · head 8e03c87
Code review result: Comments only (1 P1/P2) · head 8e03c87
Review summary
- Found 1 P1/P2 defect.
A maintainer will review this PR.
Re-review requests and limits
WALL-D reviews a PR opened ready after this rule took effect once on its own. After that it reviews only on request: comment @alpacax-wall-d review or mark a draft ready for review, up to 5 times per PR including the first review. A re-review reads only the lines changed since the last review, and from the second re-review on only P1 findings block approval. Answering the product review's questions reviews only the product side again.
|
@alpacax-wall-d review |
There was a problem hiding this comment.
WALL-D review: Approval withheld · head 6e2843c
Code review result: 1 earlier finding resolved · head 6e2843c
Product review result: Check needed (1 item, 1 to fix before merge) · head 6e2843c
A maintainer will follow up on the product items.
Re-review requests and limits
WALL-D reviews a PR opened ready after this rule took effect once on its own. After that it reviews only on request: comment @alpacax-wall-d review or mark a draft ready for review, up to 5 times per PR including the first review. A re-review reads only the lines changed since the last review, and from the second re-review on only P1 findings block approval. Answering the product review's questions reviews only the product side again.
|
Reviewed 6e2843c: #675 (review) |
|
@alpacax-wall-d review |
|
Reviewed 072fb94: #675 (review) |
|
@alpacax-wall-d review |
|
WALL-D product question (companion server behavior for sessions without a work session): confirmed. In the same release, the proxy and the server close an idle Websh session that has no work session, with code 4000 and reason Posted by the PR's coordinating agent to answer a WALL-D product question. To undo, delete this comment. |
There was a problem hiding this comment.
WALL-D review: Approval withheld · head 07f14f1
Code review result: no P1/P2 · head 07f14f1
Product review result: Check needed (1 item) · head 07f14f1
A maintainer will follow up on the product items.
Re-review requests and limits
WALL-D reviews a PR opened ready after this rule took effect once on its own. After that it reviews only on request: comment @alpacax-wall-d review or mark a draft ready for review, up to 5 times per PR including the first review. A re-review reads only the lines changed since the last review, and from the second re-review on only P1 findings block approval. Answering the product review's questions reviews only the product side again.
|
Reviewed 07f14f1: #675 (review) |
|
The companion server and proxy changes now close an idle Websh session that has no work session with code 4000 and reason |
|
Answer to the open product question on |
|
@alpacax-wall-d review |
|
No changes in 07f14f1..07f14f1. |
Summary
Websh idle handling disconnects the CLI while the shell keeps running on the server until the work session ends. Every client receives the same neutral warning, including shared joins and read-only watches.
Every Websh dial advertises
idle-warning. Owner sessions retainwebsocket-reconnecton initial and reconnect dials.A valid
idle_warningframe prints the deadline in local time to stderr:Notices remain deduplicated per deadline across reconnects, ignore invalid or elapsed deadlines, and leave terminal output and replay offsets untouched. The server's
messagefield is never printed.Close code 4000 with reason
idle_detachedends the CLI without an automatic reconnect and prints:The obsolete Websh
idle_timeoutwording is removed. File transfers are unchanged.Sessions without a work session close on
idle_timeoutand printsession closed after inactivity; close code 4000 never reconnects automatically.Reattach behavior
There is no owner reattach command after the CLI exits.
alpacon websh SERVERcreates a new session.alpacon websh join --url URL --password PASSWORDaccepts a shared invite channel. Automatic recovery applies only while the owner client is running.Validation
The updated warning assertions failed on the old wording before the fix. The regression suite covers local-time output, duplicate deadlines, history pruning, replay preservation, and a clean idle-detach exit with one dial and zero reconnect provisions.
go vet ./...: passed.go test -race -count=1 ./...: passed.gofmt -l .: empty.golangci-lint run: passed.go mod tidy: no dependency changes.Pipeline results