Skip to content

[Repo Assist] test: add terminal auth-failure coverage for PR #206 fix - #207

Closed
github-actions[bot] wants to merge 1 commit into
masterfrom
repo-assist/test-auth-failure-terminal-2026-04-24-67fb6f5ac85e6c89
Closed

github-actions[bot] wants to merge 1 commit into
masterfrom
repo-assist/test-auth-failure-terminal-2026-04-24-67fb6f5ac85e6c89

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist.

Coverage for the auth-failure backoff fix merged in PR #206 (fix: stop aggressive retry on auth failures, add setup nudge).

What's tested

PR #206 introduced two new behaviours with no test coverage:

Part 1 — reconnect counter move: reset only after hello-ok, not on TCP connect
Part 2 — terminal auth errors: set _authFailed flag and fire AuthenticationFailed event

New test What it verifies
HandleRequestError_TerminalAuthError_SetsAuthFailedFlag (theory ×3) "token mismatch", "origin not allowed", "too many failed" all set _authFailed
HandleRequestError_TerminalAuthError_RaisesAuthenticationFailedEvent AuthenticationFailed event fires with the error message text
HandleRequestError_TerminalAuthError_RaisesErrorStatus ConnectionStatus.Error is raised on terminal auth error
HandleRequestError_TerminalAuthError_OnNonConnectMethod_DoesNotSetAuthFailed Guard is scoped to connect method — other methods with same text don't set the flag
HandleHelloOk_AfterAuthFailed_ClearsAuthFailedFlag hello-ok response resets _authFailed so reconnect is re-enabled on successful auth
HandleRequestError_AllDeviceSignatureModesExhausted_SetsAuthFailed Cycling all 4 signature modes fires AuthenticationFailed exactly once

Helper additions

Two new methods on GatewayClientTestHelper:

  • GetAuthFailedFlag() — reads private _authFailed field
  • CaptureAuthenticationFailedEvents() — subscribes to AuthenticationFailed event

Test Status

  • dotnet test OpenClaw.Shared.Tests — 660 passed, 20 skipped (↑8 from 652)
  • dotnet test OpenClaw.Tray.Tests — not changed (no Tray dependency)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

Tests for the auth-failure backoff and terminal error detection added
in PR #206 (fix: stop aggressive retry on auth failures):

- HandleRequestError_TerminalAuthError_SetsAuthFailedFlag (theory):
  token mismatch / origin not allowed / too many failed → _authFailed set
- HandleRequestError_TerminalAuthError_RaisesAuthenticationFailedEvent:
  AuthenticationFailed event fired with message text
- HandleRequestError_TerminalAuthError_RaisesErrorStatus:
  ConnectionStatus.Error raised on terminal auth error
- HandleRequestError_TerminalAuthError_OnNonConnectMethod_DoesNotSetAuthFailed:
  terminal-auth guard is scoped to 'connect' method only
- HandleHelloOk_AfterAuthFailed_ClearsAuthFailedFlag:
  hello-ok response resets the flag so reconnect is re-enabled
- HandleRequestError_AllDeviceSignatureModesExhausted_SetsAuthFailed:
  cycling through all 4 signature modes fires AuthenticationFailed once

660 Shared pass (+8), 20 skipped.

Co-authored-by: Copilot <[email protected]>
shanselman added a commit that referenced this pull request Apr 27, 2026
Add test-only coverage from Repo Assist PRs #207 and #212 for terminal auth failures, shell wrapper parsing, and environment sanitization.

Co-authored-by: Copilot <[email protected]>
@shanselman

Copy link
Copy Markdown
Collaborator

Superseded by #218, which now includes this terminal auth-failure test coverage.

@shanselman shanselman closed this Apr 27, 2026
@shanselman
shanselman deleted the repo-assist/test-auth-failure-terminal-2026-04-24-67fb6f5ac85e6c89 branch April 27, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant