Skip to content

openai-codex: classify runtime failures and make full access truthful#64439

Merged
steipete merged 17 commits intoopenclaw:mainfrom
electricsheephq:codex/gpt54-runtime-truthfulness
Apr 11, 2026
Merged

openai-codex: classify runtime failures and make full access truthful#64439
steipete merged 17 commits intoopenclaw:mainfrom
electricsheephq:codex/gpt54-runtime-truthfulness

Conversation

@100yenadmin
Copy link
Copy Markdown
Contributor

Summary

This is the compact runtime-truthfulness slice of the GPT-5.4 / Codex parity program tracked in #64227.

It combines the original Contract 1 auth/runtime truthfulness work from #64229 with the Contract 4 permission truthfulness work from #64231, so OpenClaw tells the truth about both provider/runtime failures and whether /elevated full is actually available.

Scope

What changed

  • normalize OpenAI Codex authorize URLs so the required scopes are always present:
    • openid
    • profile
    • email
    • offline_access
    • model.request
    • api.responses.write
  • add typed provider/runtime failure classification for:
    • auth_scope
    • auth_refresh
    • auth_html_403
    • proxy
    • dns
    • timeout
    • schema
    • sandbox_blocked
    • replay_invalid
    • unknown
  • thread providerRuntimeFailureKind through embedded-run observation fields and lifecycle logging
  • surface more truthful user-facing copy for scope failures, refresh failures, HTML 403 auth failures, proxy/tunnel misroutes, and replay-invalid failures
  • extend embedded elevated metadata with fullAccessAvailable and fullAccessBlockedReason
  • advertise /elevated full only when auto-approved host exec is actually available for the current runtime
  • update current exec hints so unavailable full access is explained precisely instead of being suggested as if it were always possible

Validation

  • full repo check stack completed while landing the combined branch commits
  • pnpm exec vitest run src/commands/openai-codex-oauth.test.ts src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts src/agents/failover-error.test.ts src/agents/pi-embedded-error-observation.test.ts src/agents/pi-embedded-subscribe.handlers.lifecycle.test.ts src/agents/pi-embedded-runner.buildembeddedsandboxinfo.test.ts src/agents/system-prompt.test.ts src/auto-reply/reply/get-reply-run.exec-hint.test.ts

Non-goals

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR advances OpenClaw’s GPT-5.4/Codex parity effort by (1) ensuring Codex OAuth authorization URLs always include required scopes and (2) improving runtime truthfulness by classifying provider/runtime failures and accurately advertising whether /elevated full (auto-approved host exec) is actually available in the current runtime.

Changes:

  • Normalize OpenAI Codex OAuth authorize URLs to always include required scopes (including model.request and api.responses.write).
  • Introduce ProviderRuntimeFailureKind classification and thread it through error observation + lifecycle logging; update user-facing error text for several failure categories.
  • Extend embedded elevated metadata with fullAccessAvailable / fullAccessBlockedReason and adjust prompts/exec hints to avoid suggesting /elevated full when unavailable.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/plugins/provider-openai-codex-oauth.ts Normalizes authorize URLs to ensure required Codex scopes are present.
src/commands/openai-codex-oauth.test.ts Updates/adds tests validating scope normalization behavior.
src/auto-reply/reply/get-reply-run.ts Computes/threads full-access availability into exec hints and embedded runner params.
src/auto-reply/reply/get-reply-run.exec-hint.test.ts Adds coverage for the new “full unavailable” exec hint copy.
src/auto-reply/reply/commands-system-prompt.ts Includes fullAccessAvailable in sandboxInfo passed to system prompt bundle.
src/agents/system-prompt.ts Updates system prompt to advertise /elevated full only when available and explain blocked states.
src/agents/system-prompt.test.ts Adds/updates prompt assertions for full-access availability/blocked messaging.
src/agents/pi-embedded-subscribe.handlers.lifecycle.ts Threads provider runtime failure kind into lifecycle logging and observation fields.
src/agents/pi-embedded-subscribe.handlers.lifecycle.test.ts Adds assertions that runtime failure kind is logged for relevant errors.
src/agents/pi-embedded-runner/types.ts Adds EmbeddedFullAccessBlockedReason and new elevated metadata fields.
src/agents/pi-embedded-runner/sandbox-info.ts Adds resolveEmbeddedFullAccessState and plumbs full-access metadata into sandbox info.
src/agents/pi-embedded-runner.buildembeddedsandboxinfo.test.ts Verifies sandbox info carries full-access truth when provided.
src/agents/pi-embedded-helpers/errors.ts Implements provider/runtime failure kind classification + more truthful user-facing error text.
src/agents/pi-embedded-helpers.ts Re-exports provider/runtime failure kind utilities/types.
src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts Adds test coverage for provider/runtime failure kind classification.
src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts Adds test coverage for the new user-facing error messages.
src/agents/pi-embedded-error-observation.ts Extends observation fields with provider runtime failure kind (provider-aware).
src/agents/pi-embedded-error-observation.test.ts Updates expectations for new observation fields and codex scope-lane behavior.
src/agents/bash-tools.exec-types.ts Extends elevated defaults to optionally carry full-access availability + blocked reason.

Comment thread src/agents/pi-embedded-subscribe.handlers.lifecycle.ts Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 10, 2026

Greptile Summary

This PR combines auth/runtime failure classification (ProviderRuntimeFailureKind) with truthful full-access surfacing for the Codex provider. The core classification logic in errors.ts, the new resolveEmbeddedFullAccessState helper, and the OAuth scope normalization are solid. Two introduced bugs need attention before merging:

  • In handleAgentEnd, a redundant direct call to classifyProviderRuntimeFailureKind (without a parsed HTTP status) overrides observedError.providerRuntimeFailureKind — the correctly-classified value that does use the parsed status — causing JSON error payloads to be misclassified (e.g., auth_scopeunknown) in lifecycle logs.
  • In commands-system-prompt.ts, only .available is read from resolveEmbeddedFullAccessState; .blockedReason is discarded, so the system prompt always renders "runtime constraints" for unavailable full access instead of the actual reason ("host policy", "channel", etc.).

Confidence Score: 4/5

Two P1 bugs (classification override in lifecycle log, lost fullAccessBlockedReason in commands prompt) should be fixed before merging.

The core classification machinery (errors.ts, sandbox-info.ts, OAuth normalization) is correct. The two P1 issues are both straightforward one-to-three-line fixes with clear root causes, so the overall structural approach of the PR is sound.

src/agents/pi-embedded-subscribe.handlers.lifecycle.ts and src/auto-reply/reply/commands-system-prompt.ts

Comments Outside Diff (1)

  1. src/auto-reply/reply/commands-system-prompt.ts, line 110-132 (link)

    P1 fullAccessBlockedReason is discarded — system prompt always shows "runtime constraints"

    resolveEmbeddedFullAccessState returns { available, blockedReason? }, but only .available is stored in the elevated object. fullAccessBlockedReason is silently dropped, so when fullAccessAvailable === false, system-prompt.ts calls formatFullAccessBlockedReason(undefined) and always renders "runtime constraints", even when the real reason is "host-policy" (which should render "host policy").

    Store and forward the blocked reason:

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/auto-reply/reply/commands-system-prompt.ts
    Line: 110-132
    
    Comment:
    **`fullAccessBlockedReason` is discarded — system prompt always shows "runtime constraints"**
    
    `resolveEmbeddedFullAccessState` returns `{ available, blockedReason? }`, but only `.available` is stored in the `elevated` object. `fullAccessBlockedReason` is silently dropped, so when `fullAccessAvailable === false`, `system-prompt.ts` calls `formatFullAccessBlockedReason(undefined)` and always renders "runtime constraints", even when the real reason is `"host-policy"` (which should render "host policy").
    
    Store and forward the blocked reason:
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/agents/pi-embedded-subscribe.handlers.lifecycle.ts
Line: 58-86

Comment:
**Redundant computation overrides correctly-classified `providerRuntimeFailureKind`**

`providerRuntimeFailureKind` is computed here without an explicit `status` (lines 58–61), then immediately overrides `observedError.providerRuntimeFailureKind` (the spread at line 85), which was computed with the parsed `httpCode` from the JSON payload.

For Codex JSON error payloads like `{"code":401,"message":"Missing scope: api.responses.write"}`, `inferSignalStatus` in the direct call returns `undefined` (no leading HTTP status in the JSON string), so `isAuthScopeErrorMessage(raw, undefined, provider)` early-returns `false` (requires status 401 or 403), and the function falls through to `"unknown"`. Meanwhile `observedError.providerRuntimeFailureKind` correctly returns `"auth_scope"` because it passes `status: 401` from the parsed `httpCode`. The explicit assignment on line 86 clobbers the correct value.

Remove the separate computation and rely on the value already present in `observedError`:

```suggestion
    const observedError = buildApiErrorObservationFields(rawError, {
      provider: lastAssistant.provider,
    });
    const providerRuntimeFailureKind = observedError.providerRuntimeFailureKind;
```

Then remove the `classifyProviderRuntimeFailureKind` import from this file and drop the now-redundant explicit `providerRuntimeFailureKind` key at line 86 (it's already part of the spread).

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/auto-reply/reply/commands-system-prompt.ts
Line: 110-132

Comment:
**`fullAccessBlockedReason` is discarded — system prompt always shows "runtime constraints"**

`resolveEmbeddedFullAccessState` returns `{ available, blockedReason? }`, but only `.available` is stored in the `elevated` object. `fullAccessBlockedReason` is silently dropped, so when `fullAccessAvailable === false`, `system-prompt.ts` calls `formatFullAccessBlockedReason(undefined)` and always renders "runtime constraints", even when the real reason is `"host-policy"` (which should render "host policy").

Store and forward the blocked reason:

```suggestion
    const fullAccessResult = resolveEmbeddedFullAccessState({
      sandboxEnabled: true,
      execElevated: {
        enabled: params.elevated.enabled,
        allowed: params.elevated.allowed,
        defaultLevel: (params.resolvedElevatedLevel ?? "off") as
          | "on"
          | "off"
          | "ask"
          | "full",
      },
    });
    const sandboxInfo = sandboxRuntime.sandboxed
      ? {
          enabled: true,
          workspaceDir,
          workspaceAccess: "rw" as const,
          elevated: {
            allowed: params.elevated.allowed,
            defaultLevel: (params.resolvedElevatedLevel ?? "off") as "on" | "off" | "ask" | "full",
            fullAccessAvailable: fullAccessResult.available,
            ...(fullAccessResult.blockedReason
              ? { fullAccessBlockedReason: fullAccessResult.blockedReason }
              : {}),
          },
        }
      : { enabled: false };
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "test: align full-access sandbox info exp..." | Re-trigger Greptile

Comment thread src/agents/pi-embedded-subscribe.handlers.lifecycle.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc46c3641d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/auto-reply/reply/commands-system-prompt.ts Outdated
Comment thread src/auto-reply/reply/get-reply-run.ts Outdated
Copy link
Copy Markdown
Contributor Author

Addressed the current review comments on runtime truthfulness.

This push:

  • stops recomputing providerRuntimeFailureKind in lifecycle and uses the observed error as the source of truth
  • threads fullAccessBlockedReason through the commands/system-prompt path instead of dropping it
  • resolves sandbox/full-access state from the target session key in runPreparedReply

Focused validation passed locally:

  • CI=1 pnpm exec vitest run src/commands/openai-codex-oauth.test.ts src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts src/agents/failover-error.test.ts src/agents/pi-embedded-error-observation.test.ts src/agents/pi-embedded-subscribe.handlers.lifecycle.test.ts src/agents/pi-embedded-runner.buildembeddedsandboxinfo.test.ts src/agents/system-prompt.test.ts src/auto-reply/reply/get-reply-run.exec-hint.test.ts
  • pnpm build

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43a8c13fc3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/auto-reply/reply/get-reply-run.ts Outdated
Copy link
Copy Markdown
Contributor Author

Addressed the concrete checks-node-test failure from the last run and pushed follow-up commit e09eb03df4.

The failing job was not generic CI noise: src/auto-reply/reply/get-reply-run.media-only.test.ts was mocking ../../routing/session-key.js without exporting DEFAULT_AGENT_ID, and the newer agent-scope path now reads that constant while resolving sandbox runtime status.

What changed:

  • added DEFAULT_AGENT_ID and DEFAULT_MAIN_KEY to the mocked session-key module in that test

This keeps the test fixture aligned with current runtime exports without widening PR scope beyond runtime truthfulness.

Copy link
Copy Markdown
Contributor Author

Addressed the remaining branch-owned runtime-truthfulness gap on the latest head 6e36f6db1d.

What changed:

  • keep /elevated full truth correct for direct host runs instead of deriving unavailability from sandboxed=false
  • preserve explicit runtime blocks when fullAccessAvailable=false is set
  • added focused regression coverage for the host-run case

Local validation on this head:

  • pnpm build
  • CI=1 pnpm exec vitest run src/agents/pi-embedded-runner.buildembeddedsandboxinfo.test.ts src/agents/system-prompt.test.ts src/auto-reply/reply/get-reply-run.exec-hint.test.ts

Scope remains runtime truthfulness only:

  • owns auth/runtime failure classification + truthful /elevated full
  • does not own tool schema normalization, replay/liveness redesign, or parity gating.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e36f6db1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugins/provider-openai-codex-oauth.ts Outdated
Copy link
Copy Markdown
Contributor Author

Current head is now 8d24cb3504.

This update fixes the remaining branch-owned checks-node-test break on the latest head: src/auto-reply/reply/get-reply-run.media-only.test.ts now keeps the real session-key exports and only overrides the pieces the test needs, so the new runtime path can still resolve parseAgentSessionKey.

Local validation on this head:

  • CI=1 pnpm exec vitest run src/auto-reply/reply/get-reply-run.media-only.test.ts src/agents/system-prompt.test.ts src/auto-reply/reply/get-reply-run.exec-hint.test.ts

The remaining red GitHub signals appear to be shared/base CI noise rather than PR-owned regressions: the same msteams failure (conversationStore.get is not a function in extensions/msteams/src/monitor-handler/message-handler.thread-parent.test.ts) is also hitting PR C and PR D, outside this PR’s diff.

Once the rerun settles, this should be ready for human maintainer review as the runtime-truthfulness slice.

@100yenadmin
Copy link
Copy Markdown
Contributor Author

@steipete finished these now for your review Chat GPT major upgrade fixes (make GPT 5.4 = as good as Opus 4.6 in Openclaw). cut down to 4 PR's now.

Copy link
Copy Markdown
Contributor Author

Addressed the remaining runtime-truthfulness review items on head ac7a0660a0.

This update:

  • accepts slash-terminated /oauth/authorize/ paths when normalizing required Codex OAuth scopes
  • resolves sandbox/full-access state in the command system-prompt path from the target sessionKey
  • derives command-path full-access availability from the actual sandbox runtime instead of a hardcoded sandboxed assumption
  • keeps fullAccessBlockedReason flowing into sandbox prompt metadata

Focused validation passed locally:

  • CI=1 pnpm exec vitest run src/commands/openai-codex-oauth.test.ts src/auto-reply/reply/commands-system-prompt.test.ts

All currently open review threads on this PR have been resolved against the latest head.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab8151899b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/pi-embedded-helpers/errors.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Comment thread src/auto-reply/reply/get-reply-run.ts Outdated
Comment thread src/agents/pi-embedded-runner/sandbox-info.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21488fd344

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/pi-embedded-helpers/errors.ts Outdated
Copy link
Copy Markdown
Contributor Author

Current head 191d7f224c addresses the branch-owned checks-node-test-auto-reply regression: the directive-behavior expectation now includes truthful bashElevated.fullAccessAvailable metadata instead of assuming the older smaller shape.

Local validation on this head:

  • CI=1 pnpm exec vitest run src/auto-reply/reply.directive.directive-behavior.defaults-think-low-reasoning-capable-models-no.test.ts src/agents/pi-tools-agent-config.test.ts src/security/temp-path-guard.test.ts

That focused rerun passed 3/3 files and 33/33 tests locally. The other two previously failing shards from GitHub (pi-tools-agent-config and temp-path-guard) did not reproduce in this runtime-truthfulness worktree, so if they recur they should be treated as shared/base noise rather than new scope in this PR.

Scope is still runtime truthfulness only.

@steipete steipete force-pushed the codex/gpt54-runtime-truthfulness branch from 191d7f2 to 4c12b0c Compare April 10, 2026 23:54
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c12b0cec3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/media/base64.ts
Comment on lines +59 to +60
if (code <= 0x20) {
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict skipped chars to whitespace in base64 normalization

canonicalizeBase64 now skips every character with codepoint <= 0x20, which accepts non-whitespace control bytes (for example \0 or \x1F) as if they were valid separators. That means malformed payloads like YWJj\0ZA== are silently normalized to YWJjZA== instead of being rejected, weakening the validator used on media input paths. Please only skip actual whitespace characters here (matching prior behavior) so control characters still fail validation.

Useful? React with 👍 / 👎.

@steipete steipete force-pushed the codex/gpt54-runtime-truthfulness branch from 693222e to 5792ee9 Compare April 11, 2026 00:19
@steipete steipete merged commit fe6341f into openclaw:main Apr 11, 2026
21 of 26 checks passed
@steipete
Copy link
Copy Markdown
Contributor

Landed. Thanks @100yenadmin.

Follow-up fixes applied before merge:

  • Added the missing auto-reply fullAccessAvailable expectation and widened that slow e2e-style case timeout.
  • Classified raw OpenAI Codex missing-scope payloads as auth_scope even without a leading HTTP status line.
  • Kept temp-path security guard green by avoiding the flagged fixture pattern.
  • Replaced regex-based base64 canonicalization with loop validation to avoid stack overflow on oversized image payloads.
  • Stabilized the Telegram live QA abort-deadline test after the live-transport move.

Local verification:

  • pnpm format
  • pnpm check
  • pnpm build
  • pnpm test src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts extensions/qa-lab/src/live-transports/telegram/telegram-live.runtime.test.ts src/media/base64.ts src/auto-reply/reply/bash-command.stop.test.ts
  • pnpm test src/auto-reply/reply.directive.directive-behavior.defaults-think-low-reasoning-capable-models-no.test.ts -t "passes elevated defaults when sender is approved"
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test before final rebases; all lanes passed except the QA Telegram timing flake fixed afterward.

Merged as fe6341f7026d0599da4b3eefc5b021205d1a49bf.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5792ee9bee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/media/base64.ts
Comment on lines +59 to +60
if (code <= 0x20) {
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject control bytes during base64 canonicalization

Skipping every byte with codepoint <= 0x20 makes canonicalizeBase64 silently accept non-whitespace control characters (for example \0 or \x1f) as separators, so malformed payloads can be normalized into valid-looking base64 instead of being rejected. This weakens validation on media input paths that rely on this function; e.g. YWJj\0ZA== now canonicalizes to YWJjZA==.

Useful? React with 👍 / 👎.

100yenadmin pushed a commit to electricsheephq/openclaw-local-test that referenced this pull request Apr 11, 2026
…i + pruning-defaults)

Fixes three inherited failures that are red on every recent main commit
since PR B (openclaw#64439) and PR C (openclaw#64300) landed. Each failure is a stale
test surface that a production change forgot to update.

1) target-resolver.test.ts is mocking plugins/runtime.js with only
   getActivePluginChannelRegistryVersion. After src/channels/registry.ts
   started calling getActivePluginChannelRegistry + getActivePluginRegistry
   through listRegisteredChannelPluginEntries(), every resolveMessagingTarget
   test that reaches normalizeTargetForProvider fails with
   'No getActivePluginChannelRegistry export is defined on the
   ../../plugins/runtime.js mock'. Adds both exports to the mock factory
   with a registry seeded from the channels the test cases actually use
   (discord, imessage, mattermost, slack, telegram) so normalizeAnyChannelId
   resolves them the way real runtime would.

2) memory-wiki/index.test.ts expects 16 gateway methods, but
   src/gateway.ts now registers 19 after wiki.importRuns, wiki.importInsights,
   and wiki.palace were added between wiki.status and wiki.init. Extends
   the expected list to match the real registration order.

3) test/extension-test-boundary.test.ts flags
   src/config/config.pruning-defaults.test.ts as a core test that deep-imports
   extensions/anthropic/provider-policy-api.js, which violates the
   extension-test-boundary rule. Moves the test to
   extensions/anthropic/config-pruning-defaults.test.ts with inferred types
   from applyAnthropicConfigDefaults's parameter/return shape, matching the
   pattern used by the sibling provider-policy-api.test.ts.

Local validation:
- pnpm test src/infra/outbound/target-resolver.test.ts
- pnpm test extensions/memory-wiki/index.test.ts
- pnpm test extensions/anthropic/config-pruning-defaults.test.ts
- pnpm test test/extension-test-boundary.test.ts

Refs openclaw#64227
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations extensions: qa-lab size: L

Projects

None yet

3 participants