Repository navigation
fix(agents): reject unbound legacy session keys - #123222
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 8:56 PM ET / August 15, 2026, 00:56 UTC. ClawSweeper reviewWhat this changesThe PR makes agent-scoped runtime authority reject unbound legacy session keys while preserving explicit agent IDs, scoped keys, main aliases, and fixed-store ownership. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking findings. Keep this active maintainer PR open for exact-head CI and normal maintainer landing; likely related person: Peter Steinberger, who introduced the current authority boundary (high confidence). Priority: P1 Review scores
Verification
How this fits togetherContext-engine and plugin command hooks pass a session reference into the runtime LLM adapter to select an agent. The changed resolver supplies that authority before the adapter allows model completion. flowchart LR
A[Context engine or plugin command] --> B[Session reference]
B --> C[Trusted binding check]
C -->|trusted key or agent ID| D[Canonical session resolver]
C -->|unbound legacy key| E[No agent authority]
D --> F[Runtime LLM completion]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +44. Total +60 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the dedicated authority resolver, retain the general resolver’s default behavior for non-authority callers, and merge after exact-head CI confirms the supported alias and fixed-store paths. Do we have a high-confidence way to reproduce the issue? Yes—current main routes an arbitrary nonempty key through the default-capable resolver, while the existing runtime test defines the expected fail-closed outcome; this read-only review did not execute the test. Is this the best way to solve the issue? Yes—the separate authority resolver is the narrowest maintainable fix because the shared resolver intentionally supports default-agent selection for non-authority callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 61bc6128a03e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: Vincent Koc <[email protected]>
9804b14 to
8c291c5
Compare
|
Merged via squash.
|
Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: RoboClaw <[email protected]> (cherry picked from commit c00dd28)
What Problem This Solves
Fixes an issue where context-engine and plugin hooks with an arbitrary unscoped session key could inherit the default agent identity even though the key had no trusted agent binding.
This was the first product failure in the beta.2 plugin-prerelease run: https://github.com/openclaw/openclaw/actions/runs/31848220763
Why This Change Was Made
The host-owned binding resolver now accepts only explicit agent IDs, agent-scoped keys, canonical or configured main-session aliases, and persisted fixed-store ownership. It delegates those trusted forms to the canonical session resolver so owner conflicts and retired fixed-store errors retain their existing behavior; arbitrary bare keys return no authority.
The general session resolver remains unchanged because its non-authority callers intentionally support default-agent selection.
Production LOC:
+23/-7(net+16). Test LOC:+44/-0. The production growth restores the missing authority boundary while preserving the fixed-store ownership behavior introduced by the multi-agent refactor.User Impact
Context-engine and plugin LLM capabilities now fail closed when a session reference does not prove its agent owner. Explicit agent IDs, agent-scoped session keys, main aliases, and fixed-store sessions continue to work.
Release-note context: reject unbound legacy session keys when resolving agent-scoped runtime authority.
Evidence
node scripts/run-vitest.mjs src/agents/session-agent-binding.test.tsfailed when the arbitrary key reached the default-capable general resolver.node scripts/run-vitest.mjs src/agents/session-agent-binding.test.ts src/plugins/runtime/runtime-llm.runtime.test.ts— 2 files, 36 tests passed.pnpm format src/agents/session-agent-binding.ts src/agents/session-agent-binding.test.ts— passed.git diff --check origin/main...HEAD— passed..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean, no accepted/actionable findings.cbx_89c6dabe1325passed the initial guards but lacked workspace dependencies; the single frozen-install retry oncbx_3e691f7a9a93stalled after installation and was stopped. Exact-head PR CI remains required.Co-authored with Vincent Koc, preserving the original PR author's implementation credit.