fix: detect and replace stale playground instances on target port#55
Closed
heimanba wants to merge 3 commits into
Closed
fix: detect and replace stale playground instances on target port#55heimanba wants to merge 3 commits into
heimanba wants to merge 3 commits into
Conversation
- 新增 scenario/git-repo.yaml,包含 BYOC 测试环境、身份、通道、环境、隧道、vault、agent 等配置 - 支持 Qoder BYOC 内网接入验证,集成 GitHub 仓库资源端到端测试和 Alibaba BYOC 助手代理 - 设计配置引用真实 environment_id、tunnel_id,token 通过环境变量注入,保证安全性 - 在 scenario/pr.md 中添加 OpenAgentPack 正式开源说明,阐述 CMA 团队远程同事价值与应用场景 - 说明通过 Git 和 YAML 管理 CMA,实现远程 Agent 的共享、审查、迭代和持续运行 - 介绍 CMA 的自动化管理流程,包括同步、校验、计划及应用,支持多平台迁移与自动运行 Change-Id: I8b178fbb412b10dc2bc58b668a281388725f627d Co-developed-by: Qoder <noreply@qoder.com>
- 删除了byoc identity及相关配置,简化身份管理 - 移除byoc-dingtalk频道配置,减少无用渠道定义 - 去除内存存储相关注释及配置,避免冗余说明 - 精简agents中github-session-agent配置,保持核心测试逻辑 - 精简delivery配置,去除forward类型定义,明确当前配置结构 Change-Id: I4bbbe17522e6e39c63555a80fb8441807112e5cf Co-developed-by: Qoder <noreply@qoder.com>
When upgrading the CLI (e.g. from stable to beta), a previously-started
playground process may still occupy the default port. The new instance
silently binds to the next port, but the browser opens the old one —
leaving the user stuck on a stale UI.
Changes:
- playground /health now returns { playground: { version, pid } } so the
CLI can identify what is running on the port
- CLI probes the target port before spawning a new playground:
- same version → reuse the existing instance, open browser, exit
- different version → SIGTERM the old process, wait for port release,
then start the new version
- non-playground / no response → proceed normally (backward-compatible)
- Add Cache-Control: no-cache to static assets served by the playground
to prevent browsers caching stale JS/CSS across upgrades (filenames
are stable, not content-hashed, due to console embed constraints)
Change-Id: Ida50d15b60802fc8b56e13d2d9318c2cc077ad46
Co-developed-by: OpenCode <noreply@opencode.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When upgrading
@openagentpack/cli(e.g. from@latestto@beta), a previously-started playground process may still occupy port 4848. The new instance silently binds to 4849, but the browser opens 4848 — leaving the user stuck on a stale UI with missing features (e.g. no deployment/schedule UI).Root Cause
agents playgroundspawns a playground subprocess that auto-increments the port when the preferred one is busy/healthendpoint only returned{ "status": "ok" }with no version or identity informationSolution
1. Enriched
/healthendpoint (packages/playground/src/server.ts)GET /health → { "status": "ok", "playground": { "version": "0.3.0-beta-xxx", "pid": 12345 } }Registered before the server routes so it takes precedence over the generic health check from
apps/server.2. Pre-launch probe + auto-replace (
packages/cli/src/commands/playground.ts)Before spawning a new playground, the CLI now probes the target port:
/health/health3. Cache-Control for static assets
Added
Cache-Control: no-cachemiddleware for/assets/*— filenames are stable (not content-hashed) due to console embed constraints, so browsers must revalidate on every navigation to avoid serving stale JS/CSS after an upgrade.