Repository navigation
Description
Follow-up from #226, which fixes #208 but ships with the activity reporter disabled in VS Code's default state.
What happens
code-server opens /home/jovyan in Restricted Mode for new users/sessions. nebari-activity-reporter doesn't declare untrustedWorkspaces support, so VS Code disables it until the user clicks Trust. On the pack side nothing notices: _vscode_reporter_installed() in images/nebi/jupyter_server_config.py only checks that the extension directory exists, so the /vscode/ proxy opt-out (update_last_activity: False) still applies. A user who never trusts the folder gets culled at singleuserCuller.server.shutdownNoActivityTimeout while actively typing, with nothing in any log.
Repro from a local NIC (kind) run against 613a1f0, shutdownNoActivityTimeout: 180, Restricted Mode, typing continuously:
21:42:18 last_activity (VS Code opening)
21:43 -> typing; last_activity never moves again
21:45:27 server self-terminates
The extension host log for that session shows other onStartupFinished extensions activating but never nebari.nebari-activity-reporter, and no "Nebari Activity Reporter" output channel is created. After trusting the folder (same image, same user) it activates right away and keeps the session alive with a ping every 60 to 80s.
Fix
Declare untrusted support in images/jupyterlab/vscode-activity-reporter/package.json. The extension only listens to editor events and makes one local HTTP request, so this is safe:
"capabilities": {
"untrustedWorkspaces": { "supported": true }
}I think the gate should also change from "the directory exists" to "the reporter actually ran": have activate() write a marker keyed to the extension version, and have jupyter_server_config.py require it before setting update_last_activity: False. That way any future activation failure degrades to over-spending instead of culling working users. Open question on how to handle the first spawn, since the marker can only exist after VS Code has been opened once.
Acceptance: in an untrusted workspace, typing in VS Code keeps last_activity moving and the pod alive past shutdownNoActivityTimeout.
Smaller items from the #226 review, same area
onDidChangeWindowStatecounts every state change as activity, including blur and going inactive. Onlys.focused || s.activeshould count (inline suggestion on Interaction-based idle culling for VS Code (code-server) #226).- After a cull, VS Code loops "Attempting to reconnect" against a 302 to the hub, so the user never learns the server was stopped. Pre-existing, but Interaction-based idle culling for VS Code (code-server) #226 makes culling a VS Code session much more common; at least worth a line in the docs.
- code-server queries
open-vsx.org/vscode/gallery/vscode/nebari/nebari-activity-reporter/latestfor updates (404 today). The installed copy is pinned, so probably no auto-update risk, but should we claim thenebarinamespace on Open VSX? - Not yet verified in a browser: killing a terminal mid-command (the per-terminal Set fix) and the tab-closed path for
CODE_SERVER_IDLE_TIMEOUT_SECONDS.
Related: #231 (moving the ping to the *_last_activity settings seam).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Start date
Target date
Size
Activity