feat(amr): forward AMR_CLIENT_SOURCE to vela + source on wallet links#4005
Conversation
…allet links So vela analytics can attribute Open Design's command funnel and model spend back to this host (source=open_design), and the AMR wallet landing carries the source for the web page_view. - runtimes/env: set AMR_CLIENT_SOURCE=open_design for the amr agent spawn (not PII, so no telemetry-consent gate) - integrations/vela: spawnVelaLogin forwards OD_INSTALLATION_ID (consent-gated) - web/daemon: AMR wallet recharge URL gains ?source=open_design Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@lefarcen I'm holding off on generating review comments for #4005 because this pull request has merge conflicts right now. Please resolve the conflicts with main and push the updated branch. Once that's done, request or wait for the review to run again and I'll take another look. 🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos. |
…-redirect # Conflicts: # apps/daemon/src/integrations/vela.ts # apps/daemon/src/runtimes/env.ts # apps/daemon/src/server.ts # apps/web/src/runtime/amr-guidance.ts
The AMR console/recharge links the OD app opens into vela web now carry ?source=open_design so vela attributes the visit to Open Design. Update the console/recharge URL assertions accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…recharge URL DEFAULT_AMR_RECHARGE_URL now carries the source param for attribution. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lefarcen
left a comment
There was a problem hiding this comment.
The ## 背景 / ## 改动 / ## 测试 sections cover the background, change scope, and validation well — the note about _redirects not changing (to avoid mis-attribution on social-auth callback) is especially helpful context.
One quick addition: could you fill in a ## Surface area checklist? This PR introduces an env var (AMR_CLIENT_SOURCE), changes vela CLI attribution behaviour, and appends ?source=open_design to wallet links — ticking the relevant boxes (e.g. Env var, Default behavior change) would let reviewers scope the blast radius in one glance.
mrcfps
left a comment
There was a problem hiding this comment.
@lefarcen Thanks for wiring the AMR source attribution through both the CLI env and the wallet links. I found one blocking follow-up before this is ready: the recharge URL changed in production code, but the end-to-end insufficient-balance coverage is still pinned to the old URL, so this path will go red as soon as that suite runs.
🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.…sertion - tools/pack: bundle @powerformer/vela-cli 0.0.15 (the release carrying the source-attribution logic that reads AMR_CLIENT_SOURCE and tags model_request) - e2e: expect the insufficient-balance recharge URL to carry ?source=open_design (addresses review on DEFAULT_AMR_RECHARGE_URL) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The tools/pack @powerformer/vela-cli bump changed pnpm-lock.yaml, invalidating the daemon/web fetchPnpmDeps fixed-output hashes. Update to the values the Nix flake check computed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🚀 Landing page previewThis PR is deployed to a Cloudflare Pages preview — not staging or production:
|
mrcfps
left a comment
There was a problem hiding this comment.
@lefarcen I re-reviewed the updated head and didn't find any remaining actionable issues in the changed ranges. The AMR source tagging is threaded consistently through the daemon spawn env, the wallet/console URLs for the relevant profiles, and the packaged vela CLI bump is paired with the lockfile/Nix hash refresh. Thanks for tightening up the follow-up fixes here.
🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.




























































































背景
配合 vela 的「按宿主产品区分收入来源」改动(powerformer/vela#270)。让 vela CLI 把 Open Design 拉起的命令 + 模型调用归因为
source=open_design。改动(已随 main 收敛)
runtimes/env.ts:AMR agent spawn 时设AMR_CLIENT_SOURCE=open_design(紧随 main 的amrAnalyticsIdentityEnv之后)。非 PII,不走 telemetry consent 门控。amr-guidance.ts:AMR 钱包/console URL(prod/test/local 各 profile)加?source=open_design,供 vela web 的 page_view 归因。vela-errors.ts:daemon 错误卡的充值链接同样加?source=open_design。待 vela 发版后的follow-up
本改动设的
AMR_CLIENT_SOURCE需要新版 vela CLI才会被读取并注入网关 header。vela#270 合并发版后,需把 OD 打包的 vela 二进制升级到新版,收入归因才端到端生效。测试
@open-design/daemontypecheck 通过(仅本地缺 node-pty 原生依赖的无关报错)。🤖 Generated with Claude Code