Skip to content

fix: doctor memory calls reject unknown agent targets - #115365

Merged
steipete merged 1 commit into
mainfrom
codex/validate-doctor-memory-agent-id
Jul 28, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/validate-doctor-memory-agent-id

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operator clients could send an unknown or non-string agentId to doctor.memory.* gateway methods and make them enter an unintended agent namespace or silently target the default agent. For doctor.memory.status, that could acquire a memory manager and bootstrap agent-scoped SQLite state before the target was known to be configured.

Why This Change Was Made

The doctor memory handlers now share one validation boundary that rejects non-string IDs and checks normalized explicit IDs against the configured agent roster before resolving a workspace or acquiring a memory manager. Omitting agentId still preserves the existing default-agent contract.

The agent-targeting surface was added in #78748; the later shared doctor target resolver retained its normalization-only behavior. Other similar gateway handlers were audited: their lookalike paths are already protected by protocol validators and/or configured-agent checks, while the doctor memory methods had no request-schema gate.

User Impact

Invalid explicit agent targets now return INVALID_REQUEST without creating or touching agent-scoped memory state. Configured agents and callers that omit agentId behave as before.

Evidence

  • Regression-first Testbox proof: all 14 unknown/non-string cases failed against the old handlers, while the existing 31 cases passed.
  • Fixed Testbox proof: pnpm test src/gateway/server-methods/doctor.test.ts — 45/45 passed.
  • Full changed gate on Blacksmith Testbox: pnpm check:changed — format, production/test typechecks, lint, architecture, boundary, and storage guards passed.
  • git diff --check passed.
  • Codex autoreview (--mode uncommitted) reported no accepted/actionable findings.

@steipete steipete self-assigned this Jul 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Jul 28, 2026
@steipete
steipete merged commit ed25be0 into main Jul 28, 2026
122 of 126 checks passed
@steipete
steipete deleted the codex/validate-doctor-memory-agent-id branch July 28, 2026 18:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to christian-lallo/openclaw that referenced this pull request Jul 28, 2026
* origin/main: (61 commits)
  perf(ui): debounce event-driven session list refreshes and right-size child paging (openclaw#115374)
  feat(talk): support GPT-Live realtime voice over ChatGPT OAuth (openclaw#115226)
  feat(system-agent): guide gateway configuration in Ask OpenClaw (openclaw#115363)
  fix(agents): make overflow recovery append-only via branch-and-reappend (openclaw#115271) (openclaw#115310)
  fix(macos): bound websocket ping so a dropped pong cannot orphan its continuation (openclaw#115362)
  fix(codex): isolate native hook relay startup (openclaw#115078)
  fix(ci): stop reviving superseded pull request workflows (openclaw#115378)
  feat(openshell): add workspace selection (openclaw#114952)
  fix(skills): persist workshop apply reason; correct Skill Workshop docs (openclaw#114471)
  fix: agent stops replying when a session transcript has no header row (openclaw#115080)
  perf(usage): stale-while-revalidate caches for usage.status and sessions.usage (openclaw#115369)
  fix(discord): reject invalid UTF-8 probe responses (openclaw#111734)
  feat(gateway): add memory.search operator method (openclaw#115346)
  fix(android): keep welcome action reachable with large text (openclaw#111747)
  fix(gateway): validate doctor memory agent ids (openclaw#115365)
  refactor: harden shell completion and shard Control UI E2E (openclaw#115332)
  fix(ui): anchor the thread branches menu to its trigger button (openclaw#115352)
  perf(sessions): incremental snapshot revalidation and shallow list projections (openclaw#115359)
  refactor(sessions): consolidate entry state (openclaw#115299)
  feat(ui): swap three plain Lobsterdex palettes for balloon, ascii, and portal (openclaw#115308)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant