Skip to content

feat: add Windows RDP keepalive monitor#898

Open
mrshu wants to merge 1 commit into
coder:mainfrom
mrshu:feat/windows-rdp-keepalive
Open

feat: add Windows RDP keepalive monitor#898
mrshu wants to merge 1 commit into
coder:mainfrom
mrshu:feat/windows-rdp-keepalive

Conversation

@mrshu
Copy link
Copy Markdown

@mrshu mrshu commented May 20, 2026

Summary

  • add opt-in keepalive settings to the windows-rdp module
  • install a background PowerShell monitor that detects established RDP sessions
  • extend the workspace deadline through the documented workspace API while RDP is active
  • document the keepalive knobs and cover the rendered script output

Testing

  • PATH=/tmp/coder-test-bin:/tmp/terraform-bin:$PATH npm exec --yes --package=bun@latest -- bun test registry/coder/modules/windows-rdp/main.test.ts
  • /tmp/terraform-bin/terraform fmt -check -diff /tmp/coder-registry/registry/coder/modules/windows-rdp/main.tf
  • /tmp/terraform-bin/terraform -chdir=/tmp/coder-registry/registry/coder/modules/windows-rdp validate
  • npx prettier --check registry/coder/modules/windows-rdp/README.md registry/coder/modules/windows-rdp/main.test.ts
  • git diff --check

Fixes #200

/claim #200

Previously the Windows RDP module configured desktop access but did not
report activity while an RDP session was connected. This commit adds a
small agent-token based monitor so RDP usage can extend the workspace.

- Add keepalive variables and workspace lookup in `windows-rdp/main.tf`
- Start a PowerShell monitor that checks established RDP sessions
- Document the keepalive settings and cover rendered script output
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15cc26ca1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


variable "keepalive_enabled" {
type = bool
default = true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make keepalive opt-in by default

Setting keepalive_enabled to true changes behavior for all existing windows-rdp users on their next apply: any active RDP connection will continuously extend deadlines and can prevent expected auto-stop behavior, increasing runtime/cost without explicit user action. Because this feature is described as opt-in, the default should remain disabled to avoid a backward-incompatible rollout.

Useful? React with 👍 / 👎.

Comment on lines +138 to +140
$scriptDir = "C:\coder"
$scriptPath = Join-Path $scriptDir "rdp-keepalive.ps1"
$logPath = Join-Path $scriptDir "rdp-keepalive.log"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Store keepalive artifacts in the module data root

The keepalive monitor writes runtime script/log files to C:\coder, which bypasses the repository’s required module data layout ($HOME/.coder-modules/<namespace>/<module>/...) for module-managed artifacts. This makes logs/scripts harder to discover consistently and breaks the standard location contract used for support and maintenance.

Useful? React with 👍 / 👎.

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.

Windows RDP Keep Alive - Extend workspace sessions during active RDP connections

1 participant