Skip to content

Retry Jupyter proxy requests after token refresh#1101

Merged
jlewi merged 1 commit into
mainfrom
dev/jlewi/jupytercache
Apr 9, 2026
Merged

Retry Jupyter proxy requests after token refresh#1101
jlewi merged 1 commit into
mainfrom
dev/jlewi/jupytercache

Conversation

@jlewi

@jlewi jlewi commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Retry Jupyter HTTP proxy requests after a 403 when the on-disk server token changed
  • Reload the Jupyter server registry from ${RUNME_CONFIG_DIR}/jupyter/*.json before retrying
  • Add a regression test that verifies a stale token request is retried with the refreshed token

Root Cause

The Jupyter proxy cached server records in memory and only reloaded them on cache misses. After a local Jupyter server restarted on the same port, the on-disk token changed, but existing cached records kept forwarding the old token and Jupyter returned 403.

Fixes runmedev/web#164

Validation

  • go test ./pkg/agent/server
  • go test ./pkg/agent/server -run TestForwardHTTP_ReloadsTokenAfterForbidden -count=1
  • git diff --check
  • runme run lint test passed lint, but full tests are blocked locally by missing integration dependencies (deno, direnv, tree, Dagger Shell digest) and shell-init z noise in PTY tests
  • make test-docker was attempted as the documented fallback, but the configured remote Docker context certificate is expired and local Docker Desktop is not running

@jlewi jlewi marked this pull request as ready for review April 8, 2026 12:46
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
@jlewi jlewi force-pushed the dev/jlewi/jupytercache branch from e10cd26 to 09c13f0 Compare April 9, 2026 03:48
@jlewi jlewi merged commit 7c15e41 into main Apr 9, 2026
6 checks passed
@jlewi jlewi deleted the dev/jlewi/jupytercache branch April 9, 2026 03:52
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.

Bug: Jupyter Server Token Is Cached In memory - not reloaded automatically

1 participant