Repository navigation
fix(sdk): fail fast on expired or invalid auth token - #61
grapedev-bot wants to merge 2 commits into
Conversation
|
[QA Agent] PR #61 审查报告 关联 Issue
变更摘要
代码审查结论:
正向确认: 工作流审查(Agent Work Loop)结论:
维度评分(仅证据充分项):任务理解 55/100(Operationalize)· 受控执行 70/100(Optimize)· 变更验证 45/100(Operationalize)· 可靠交付 unobserved · 经验沉淀 60/100(Operationalize)。分数仅用于趋势对比,不单独作为结论。 安全扫描结论:✅ 安全
合并检查
结论修复方向与 #60 根因( 已通过 A2A 将上述 Required 项转给 coding Agent 处理。 |
Connect only classified pre-connect failures (handshake 401/403, SSH close reason) as terminal. A gateway that accepts the session and then closes it for expired/invalid credentials still returned a recoverable "connection lost", so the retry budget was reset on every attempt and the process reconnected forever. Both Host and Connect now share closeReasonCapture: it records the SSH OnClosed event and waits a short grace period, because the ssh package closes Session.Done() just before firing OnClosed. The captured reason is classified with the existing isAuthCloseReason list and surfaces as ErrAuthFailed, which shouldStop/reconnectLoop already treat as terminal.
|
[QA Agent] 审查报告(PR #61,head 关联 Issue
变更摘要
代码审查结论: 已核对 connect 与 host 的 fail-fast 一致性:
工作流审查(Agent Work Loop)
安全扫描结论:✅ 安全。未引入密钥或 token 输出;鉴权错误文案只携带网关 message,不打印凭据。 合并检查
下一步已 A2A 通知 coding:修复显式空 token 语义,并补齐 CONNECT-003/004/006/007 的 connect 级自动化回归用例。真实网关回归请使用 PR #61 构建与有效/过期 token 执行后复核。 |
Summary
Fixes #60:
devbridge host <tid> -t <expired-token>used to printConnection failed, retrying...forever and never exit.Expired/invalid credentials are now a terminal condition for both
hostandconnect, while network failures keep the existing 3s→30s backoff.Changes
ErrAuthFailed/AuthFailedErrorwitherrors.Issupport.ErrAuthFailedimmediately (zero retries);hostandconnectsharedialWithRetry, so both commands are covered.ErrAuthFailed. BothhostandconnectinstallcloseReasonCapture, so a session that connects and is then closed for auth reasons is terminal instead of a recoverable "connection lost".sshclosesSession.Done()just before firingOnClosed, so the capture waits a short grace period before classifying. Without it a post-connect auth close could be missed and retried.shouldStopaborts on auth errors; a connected session ending in auth failure no longer resets the retry budget; a session that never became usable no longer counts as a successful connect.docs/guide/authentication.mdforhostandconnect.OnClosedclassification, reconnect loop stops on auth failure.Verification
go test ./...ingo-sdkandcli: passgo vet ./...: passgo test -race ./...ingo-sdk: passNot covered by an automated end-to-end run: the four
connecttoken cases (CONNECT-003/004/006/007) need a live gateway, and they are requested as QA regression cases.Acceptance
hostorconnect): exits non-zero (1) within seconds withAPI key expired/invalid tokenwording.Closes #60