Skip to content

fix(compliance): force live probe for manual agent refresh#5825

Open
garvitkaushik-123 wants to merge 1 commit into
adcontextprotocol:mainfrom
garvitkaushik-123:fix/refresh-status-cache-bypass
Open

fix(compliance): force live probe for manual agent refresh#5825
garvitkaushik-123 wants to merge 1 commit into
adcontextprotocol:mainfrom
garvitkaushik-123:fix/refresh-status-cache-bypass

Conversation

@garvitkaushik-123

Copy link
Copy Markdown
Contributor

Summary

recommend_storyboards/evaluate_agent_quality already probe live (they call into @adcp/sdk directly), but the "Recheck Status" button on the Agents page backs onto POST /api/registry/agents/{url}/refreshCrawlerService.refreshSingleAgent, which calls the same discoverCapabilities / checkHealth / getStats / getFormatsForAgent helpers used by the periodic crawler.

Each of those helpers only skips its 15-minute in-memory cache when the caller passes saved owner auth. For an agent with no saved credentials (or an admin refreshing someone else's agent), a manual refresh click still read the stale cached snapshot for up to 15 minutes after the agent's own redeploy fix, even though the live endpoint was already returning the correct response.

Fix

  • Add an explicit forceRefresh parameter to CapabilityDiscovery.discoverCapabilities, HealthChecker.checkHealth/getStats, and FormatsService.getFormatsForAgent.
  • refreshSingleAgent (the function backing "Recheck Status") now passes forceRefresh: true on every call, independent of whether owner auth is available.
  • Cache-write behavior is unchanged — a forced refresh still updates the shared cache, so periodic/unauthed reads benefit from the fresh data too.

Scoped to this repo's own caching layer only; no changes to @adcp/sdk or Addie's MCP tools (their conversational probe path already worked, per the reporter's own testing).

Fixes #5777.

Test plan

  • npx tsc --noEmit -p server/tsconfig.json
  • npx vitest run server/tests/unit/formats.test.ts server/tests/unit/health-fallback.test.ts server/tests/unit/reprobe-unknown-agents.test.ts server/tests/unit/capability-discovery-auth-classification.test.ts (54 passed)
  • Added two new unit tests covering default TTL-cache behavior and forceRefresh bypass

Recheck Status only skipped the 15-minute capability/health/formats
cache when the caller had saved owner auth. Agents with no saved
credentials kept serving a stale cached snapshot after a redeploy
fix, even though a manual refresh should always hit the live
endpoint.

Thread an explicit forceRefresh flag through discoverCapabilities,
checkHealth, getStats and getFormatsForAgent, and set it from
refreshSingleAgent (the "Recheck Status" code path) regardless of
whether owner auth is present.

@aao-release-bot aao-release-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Argus review could not complete

The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final gh pr review). A human reviewer should take this PR.

View workflow run

This is an automated message from the Argus AI review workflow.

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.

Compliance runner serves stale capabilities despite live endpoint returning correct response

1 participant