openclaw - 💡(How to fix) Fix OC 2026.4.23 schema validator rejects hooks.allowConversationAccess (loader expects it) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73806Fetched 2026-04-29 06:14:52
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

Schema/loader drift in OC 2026.4.23: the zod config validator only accepts plugins.entries.<id>.hooks.allowPromptInjection, but the plugin loader reads and enforces allowConversationAccess for non-bundled plugins that register conversation-class typed hooks (llm_input, llm_output, agent_end).

Net effect: a non-bundled plugin can never register conversation hooks. Setting allowConversationAccess: true is rejected at config-validation time. Omitting it causes the loader to block the typed hooks at runtime with diagnostic:

typed hook "llm_input" blocked because non-bundled plugins must set plugins.entries.<id>.hooks.allowConversationAccess=true

Error Message

pushDiagnostic({ level: "warn", ..., message: typed hook "${hookName}" blocked because non-bundled plugins must set plugins.entries.${record.id}.hooks.allowConversationAccess=true });

Root Cause

typed hook "llm_input" blocked because non-bundled plugins must set plugins.entries.<id>.hooks.allowConversationAccess=true

Fix Action

Fix / Workaround

  • completion-event-writer (and any third-party plugin needing conversation hooks) cannot function on 2026.4.23.
  • No workaround in user config — this requires either a schema patch or running the plugin as bundled (record.origin === "bundled").

Code Example

hooks: z.object({ allowPromptInjection: z.boolean().optional() }).strict().optional(),

---

allowPromptInjection: hooksRaw.allowPromptInjection,
allowConversationAccess: hooksRaw.allowConversationAccess
...
const normalizedHooks = hooks && (typeof hooks.allowPromptInjection === "boolean" || typeof hooks.allowConversationAccess === "boolean") ? { ... } : {};

---

if (isConversationHookName(hookName)) {
  const explicitConversationAccess = policy?.allowConversationAccess;
  if (record.origin !== "bundled" && explicitConversationAccess !== true) {
    pushDiagnostic({ level: "warn", ..., message: `typed hook "${hookName}" blocked because non-bundled plugins must set plugins.entries.${record.id}.hooks.allowConversationAccess=true` });
    return;
  }
  ...
}

---

const PROMPT_INJECTION_HOOK_NAMES = ["before_prompt_build", "before_agent_start"];
const CONVERSATION_HOOK_NAMES   = ["llm_input", "llm_output", "agent_end"];

---

"plugins": {
     "entries": {
       "completion-event-writer": {
         "enabled": true,
         "hooks": { "allowConversationAccess": true }
       }
     }
   }

---

hooks: z.object({
  allowPromptInjection: z.boolean().optional(),
  allowConversationAccess: z.boolean().optional()
}).strict().optional(),
RAW_BUFFERClick to expand / collapse

Summary

Schema/loader drift in OC 2026.4.23: the zod config validator only accepts plugins.entries.<id>.hooks.allowPromptInjection, but the plugin loader reads and enforces allowConversationAccess for non-bundled plugins that register conversation-class typed hooks (llm_input, llm_output, agent_end).

Net effect: a non-bundled plugin can never register conversation hooks. Setting allowConversationAccess: true is rejected at config-validation time. Omitting it causes the loader to block the typed hooks at runtime with diagnostic:

typed hook "llm_input" blocked because non-bundled plugins must set plugins.entries.<id>.hooks.allowConversationAccess=true

Evidence (from a 2026.4.23 install at /home/boss/.npm-global/lib/node_modules/openclaw/dist/)

Schema (rejects allowConversationAccess): zod-schema-BhKK4qYw.js:775

hooks: z.object({ allowPromptInjection: z.boolean().optional() }).strict().optional(),

The .strict() here forbids any other key, including allowConversationAccess.

Manifest registry (normalizes both keys): manifest-registry-D5n47dku.js:261-266

allowPromptInjection: hooksRaw.allowPromptInjection,
allowConversationAccess: hooksRaw.allowConversationAccess
...
const normalizedHooks = hooks && (typeof hooks.allowPromptInjection === "boolean" || typeof hooks.allowConversationAccess === "boolean") ? { ... } : {};

Loader (enforces allowConversationAccess): loader-DeOtDUYt.js:1285-1303

if (isConversationHookName(hookName)) {
  const explicitConversationAccess = policy?.allowConversationAccess;
  if (record.origin !== "bundled" && explicitConversationAccess !== true) {
    pushDiagnostic({ level: "warn", ..., message: `typed hook "${hookName}" blocked because non-bundled plugins must set plugins.entries.${record.id}.hooks.allowConversationAccess=true` });
    return;
  }
  ...
}

Hook classification (the two sets are disjoint): types-tVEbjKoB.js:184-191

const PROMPT_INJECTION_HOOK_NAMES = ["before_prompt_build", "before_agent_start"];
const CONVERSATION_HOOK_NAMES   = ["llm_input", "llm_output", "agent_end"];

So allowPromptInjection cannot be used as a substitute — it gates a different set of hooks.

Repro

  1. Install any non-bundled plugin that registers llm_input / llm_output / agent_end (e.g. completion-event-writer).
  2. Try to set:
    "plugins": {
      "entries": {
        "completion-event-writer": {
          "enabled": true,
          "hooks": { "allowConversationAccess": true }
        }
      }
    }
  3. Config validator rejects the file (strict schema).
  4. Remove the hooks block: file validates, but loader emits the "blocked because non-bundled plugins must set …" warning and the 3 typed hooks never register.

Suggested fix

Update the zod schema at zod-schema-BhKK4qYw.js:775 (i.e. the source plugins/config-normalization-shared plugin-entry hooks shape) to:

hooks: z.object({
  allowPromptInjection: z.boolean().optional(),
  allowConversationAccess: z.boolean().optional()
}).strict().optional(),

Both flags are already present in the runtime types (plugin-sdk/.../types.plugins.d.ts, config-normalization-shared.d.ts) and in the manifest registry — only the validator schema is out of sync.

Impact

  • completion-event-writer (and any third-party plugin needing conversation hooks) cannot function on 2026.4.23.
  • No workaround in user config — this requires either a schema patch or running the plugin as bundled (record.origin === "bundled").

Environment

  • OC 2026.4.23 (LX, Ubuntu 24.04, Node global install at ~/.npm-global/lib/node_modules/openclaw)
  • Discovered while wiring completion-event-writer for typed-hook completion logging.

extent analysis

TL;DR

Update the zod schema to include allowConversationAccess as an optional boolean property to resolve the schema/loader drift issue.

Guidance

  • The issue is caused by a mismatch between the zod schema and the runtime types, where the schema does not allow allowConversationAccess but the loader enforces it.
  • To verify the issue, try setting allowConversationAccess in the config and observe the config validator rejection or the loader warning.
  • Update the zod schema at zod-schema-BhKK4qYw.js:775 to include allowConversationAccess as an optional boolean property.
  • After updating the schema, revalidate the config and verify that the loader no longer blocks the typed hooks.

Example

hooks: z.object({
  allowPromptInjection: z.boolean().optional(),
  allowConversationAccess: z.boolean().optional()
}).strict().optional(),

Notes

This fix assumes that the allowConversationAccess property is intended to be optional and that the loader's enforcement of this property is correct. If this is not the case, further investigation may be necessary.

Recommendation

Apply the suggested fix by updating the zod schema to include allowConversationAccess as an optional boolean property, as this will resolve the schema/loader drift issue and allow non-bundled plugins to register conversation hooks.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix OC 2026.4.23 schema validator rejects hooks.allowConversationAccess (loader expects it) [1 comments, 2 participants]