Skip to content

feat(cloudflare): respect explicit APP_PID for umbrella-registered instances#491

Open
xiaomoziyi wants to merge 2 commits intomasterfrom
fix/cloudflare-explicit-app-pid
Open

feat(cloudflare): respect explicit APP_PID for umbrella-registered instances#491
xiaomoziyi wants to merge 2 commits intomasterfrom
fix/cloudflare-explicit-app-pid

Conversation

@xiaomoziyi
Copy link
Copy Markdown
Contributor

@xiaomoziyi xiaomoziyi commented Apr 11, 2026

Summary

ensureRegistered 里如果存在 env.APP_PID,直接把它作为 instance DID 返回,跳过 AUTH_SERVICE.registerApp 的自动注册逻辑。

场景:staging-aigne-hub-media-kit 这种使用 umbrella SK+PSK 预注册的实例,canonical PID 已经在外部注册好,不应该被请求期的 auto-register 用 SK 派生出来的 DID 覆盖。

Behavior

环境 APP_PID AUTH_SERVICE + APP_SK 结果
独立部署(原行为) 调用 registerApp 自动注册,缓存返回的 instanceDid
umbrella 预注册(本 PR) 直接返回 APP_PID,不调 registerApp
兜底 返回空字符串(行为不变)

Test plan

  • Deploy 到使用 umbrella PID 的 staging Worker
  • 日志里不应出现 [media-kit] Registered as instance: ... — 走的是 explicit PID 短路分支
  • GET /api/status 返回的 instanceDid 等于 APP_PID
  • 独立部署环境(未设 APP_PID)auto-register 行为保持不变

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 11, 2026

Image description AIGNE Framework

…stances

When an instance has been pre-registered out-of-band with an umbrella PID
(e.g. staging-aigne-hub-media-kit, which shares the Payment Kit umbrella
SK+PSK), auto-registration would otherwise overwrite the canonical PID
with a fresh SK-derived DID on first request. Respect an explicit APP_PID
binding in ensureRegistered and short-circuit before calling registerApp,
so the canonical PID is preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xiaomoziyi xiaomoziyi force-pushed the fix/cloudflare-explicit-app-pid branch from 2bdbeac to 4946c9f Compare April 11, 2026 04:21
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