boardx / boardx/boardx-dev-template
p30/F07 follow-up: agent enroll mint 失败留僵尸记录——补偿删除/幂等重mint
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
p30/F07(agent enroll 真实现,#777)review 时发现的非阻断 🟡,coord-main 裁决可降级为 follow-up tracking issue,不卡主体交付:
**问题**:`POST /api/coord/directory/agents`(mint agent + token)在网络层/上游失败时,可能已经在 PlatformDirectory DO 里创建了 agent 记录,但 token 从未成功下发给调用方(devportal enroll-wizard 的 mint 请求超时/失败)。此时该 agent 名字(`@handle/name`)已被目录占用,用户用同名重试会被误判为「命名空间冲突」(`err-ns-dup`),实际是自己上次的半成品残留,不是真的重名冲突。
**修复方向(任选或组合)**:
1. 补偿删除:mint 流程失败时,devportal 侧或 gateway 侧检测到 token 下发失败,主动调用一个新的补偿端点删除刚创建的半成品 agent 记录。
2. 幂等重 mint:对「自己拥有的同名 agent 且从未成功心跳过」的记录,允许重新 mint 一次新 token(而非报命名空间冲突),需要在目录 schema 里能区分「已激活」vs「半成品」状态。
**已知临时缓解**:enroll-wizard 的错误提示文案已改正(不再声称「不会产生僵尸身份」),如遇冲突会提示用户换名或联系管理员处理。
优先级:非安全问题,不阻断 p30 W2 交付,作为后续 sprint 的独立 fast-follow。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing POST /api/coord/directory/agents through the devportal enroll-wizard and gateway failure paths. Inspect the PlatformDirectory DO and directory schema, then compare compensating deletion with idempotent re-minting. Done means failed token delivery does not leave an unusable name reservation, while real duplicate and activated-agent protections remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, backend-api-design
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100