Skip to content

fix(core): encode GitLab version-endpoint auth in dag-init probe - #314

Merged
LeXwDeX merged 2 commits into
devfrom
fix/dag-init-gitlab-probe
Aug 17, 2026
Merged

fix(core): encode GitLab version-endpoint auth in dag-init probe#314
LeXwDeX merged 2 commits into
devfrom
fix/dag-init-gitlab-probe

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Closes #312

问题

/dag-init 自建 GitLab 探测段把裸 curl 放第一位、认证调用写成"或者"——而 GitLab 的 /api/v4/version 按 API 设计要求认证,健康实例对裸请求返回 401 是标准行为。照文本执行的 agent 必吃一次失败才反应过来(git.ycgame.com 实弹已复现:curl 401 → glab 认证通道兜底)。

修复(提示词卫生)

改写 dag-init.txt 探测段,编码两个认知点:

  1. 401 是阳性证据——端点存在且在应答,恰好证明是 GitLab;version JSON 或 401/GitLab 形状错误 → 判定 GitLab;连接拒绝/非 GitLab 应答 → STOP
  2. 认证调用是复核主路径——判定为 GitLab 且 step 2 鉴权通过后 glab api version 复核

验证

  • packages/core bun typecheck
  • bun test test/plugin/command.test.ts 21/21 ✅(新增两条锚点断言:401 is POSITIVEre-verify with glab api version

后续 agent 按文本一次通过自建实例探测,不再消耗失败回合。

feat(core): release v1.0.23 — built-in /dag-init and /dag-auto ultra-flow commands
…t probe

GitLab's /api/v4/version requires authentication by API design, so a
healthy self-hosted instance answers a bare curl with 401. The probe text
listed the authenticated call as an alternative, so agents following it
verbatim burned a failed round before discovering this (hit live against
git.ycgame.com). Encode both facts: a 401 is positive evidence that the
endpoint exists and answers, and glab api version is the re-verification
step after auth passes.
@LeXwDeX
LeXwDeX merged commit 1f3c381 into dev Aug 17, 2026
5 checks passed
@LeXwDeX
LeXwDeX deleted the fix/dag-init-gitlab-probe branch August 17, 2026 04:19
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