Skip to content

fix(cli): print usable Jupyter entry URL#294

Merged
eetoc merged 1 commit into
mainfrom
fix/jupyter-non-exposed-url
Jul 15, 2026
Merged

fix(cli): print usable Jupyter entry URL#294
eetoc merged 1 commit into
mainfrom
fix/jupyter-non-exposed-url

Conversation

@eetoc

@eetoc eetoc commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • print the Jupyter token-redirect entry when a run enables Jupyter without exposing its tokenized notebook URL
  • preserve the direct /lab?token=... URL when the daemon returns an exposed notebook URL
  • keep the reported proxy path unchanged for JSON consumers
  • add regression coverage for non-exposed, exposed, trailing-slash, and already-normalized paths

Verification

  • go test ./cmd/agent-compose -run 'TestIntegrationCLIRun(JupyterWithoutExposePrintsTokenRedirectEntry|SendsJupyterExpose)|TestJupyterBrowserLocation' -count=1\n- go test ./cmd/agent-compose -count=1\n- task lint\n- real Docker sandbox: the non-exposed URL redirected to a tokenized JupyterLab URL and completed with HTTP 200\n- real Docker sandbox: the exposed tokenized URL opened JupyterLab directly with HTTP 200\n\n## Known environment failures\n\n- task test reached deploy/install_test.sh and failed an existing incomplete-rollback message assertion (recovery was incomplete)\n- the full Linux artifact build could not refresh runtime artifacts because Docker Hub timed out while fetching golang:1-alpine

@monkeyscan

monkeyscan Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Title: fix(cli): print usable Jupyter entry URL

Commit: 6c5ee2d

本次变更在 cmd/agent-compose/cli_jupyter.go 中新增了 jupyterBrowserLocation 函数,用于决定 Jupyter 浏览器跳转的目标路径:当存在暴露模式下的 notebookURL 时直接使用;否则从 proxyPath 去掉 /lab 后缀,得到入口重定向路径。同时在 main_test.go 中补充了集成测试和单元测试,验证私有 Jupyter 模式(--jupyter--jupyter-expose)会打印 token redirect entry 路径而非直接的 /lab 路径。

代码逻辑简洁,边界场景(尾部斜杠、根路径 /lab、已存在的 entry path、暴露模式 notebookURL)均有测试覆盖。resolveRunJupyterOutputPath 字段保留原始 proxyPath,URL 字段使用新的入口路径,职责分离清晰。未发现有正确性、安全或回归风险。

@eetoc

eetoc commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Manual verification completed with real Docker sandboxes:

  • --jupyter: CLI printed the sandbox entry URL without /lab or a token; the entry returned HTTP 307 to the tokenized JupyterLab URL, which returned HTTP 200.
  • --jupyter-expose: CLI printed the tokenized /lab URL directly, and it returned HTTP 200 with JupyterLab.

The test sandboxes remained running during browser verification.

@eetoc
eetoc marked this pull request as ready for review July 14, 2026 17:14
@eetoc
eetoc merged commit d1525c0 into main Jul 15, 2026
16 checks passed
@eetoc
eetoc deleted the fix/jupyter-non-exposed-url branch July 15, 2026 02:53
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