8000 fix(ghcli): cache unanswered login lookups by opsmon · Pull Request #232 · aenix-io/aeman · GitHub
[go: up one dir, main page]

Skip to content

fix(ghcli): cache unanswered login lookups - #232

Merged
kvaps merged 1 commit into
aenix-io:mainfrom
opsmon:189
Sep 19, 2026
Merged

kvaps merged 1 commit into
aenix-io:mainfrom
opsmon:189

Conversation

@opsmon
@opsmon opsmon commented Sep 16, 2026
Copy link
Copy Markdown
Contributor

fix(ghcli): cache unanswered login lookups

Closes #189

Repeated failed identity lookups currently launch gh api user on every
request while holding the package mutex.

Cache errors and empty identity responses by token value for
forge.UnansweredTTL (30 seconds). Retry after expiry or when a newly read
token changes, preserving existing successful caching and error semantics.
Caller cancellation is excluded from the cache. The existing five-minute
token refresh interval remains unchanged.

The subprocess remains under the package mutex, so concurrent callers share
one attempt per unanswered window. Regression reproduction: 20 calls launch
1 subprocess instead of 20.

Testing

  • Nine regression tests cover failure caching, expiry, recovery, token
    rotation, successful caching, empty replies, cancellation, concurrency,
    and lookup behavior without a token key.
  • Package tests, race detection, relevant credential tests, and
    go test ./... passed.
  • Behavior-matrix validation and git diff --check passed.
  • Lint could not run locally because golangci-lint is not installed.

Related issue

Fixes #189 — A gh identity lookup that fails is repeated on every request.

Follows the unanswered-cache policy introduced in PR #164.

@kvaps
kvaps merged commit b327989 into aenix-io:main Sep 19, 2026
2 checks passed
@opsmon
opsmon deleted the 189 branch September 20, 2026 08:21
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.

A gh identity lookup that fails is repeated on every request

2 participants

0