feat(config): add allowFrom fallback transition foundation#81259
feat(config): add allowFrom fallback transition foundation#81259mcaxtr wants to merge 5 commits into
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. this is transition-foundation feature work rather than a bug report. The intended behavior is source-checkable in the PR head and covered by targeted tests listed in the PR body, but I did not run tests in this read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Review and land the dormant metadata-driven transition seam once CI is green, leaving actual per-channel fallback removals to later channel-owned PRs. Do we have a high-confidence way to reproduce the issue? Not applicable: this is transition-foundation feature work rather than a bug report. The intended behavior is source-checkable in the PR head and covered by targeted tests listed in the PR body, but I did not run tests in this read-only review. Is this the best way to solve the issue? Yes as a direction: a dormant metadata-driven seam plus doctor preservation copying is the narrow maintainable path for later channel-owned fallback removals. Because it changes authorization/config plumbing, maintainer review and CI remain the correct merge gate. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7715b29aa231. Re-review progress:
|
ed54eee to
4413aa1
Compare
4413aa1 to
c314391
Compare
|
Thanks for putting this together. I am going to close this PR and take over the change in a smaller shape. The direction should be a doctor migration, not a dormant runtime/manifest fallback-transition framework. We should preserve existing effective access by having The current PR adds too much future-facing authorization plumbing for that goal, especially the |
Purpose
This PR adds the generic, dormant machinery needed to disable legacy
allowFromfallback per channel later. It does not disable fallback for any channel in this PR.User Config Impact
This PR does not add user-facing fallback flags.
Users should never set
*FallbackToAllowFromin their OpenClaw config. Those booleans are channel runtime/package metadata for future channel-owned PRs.The only user config change
openclaw doctor --fixmay make is copying existing allowlist values fromallowFrominto the explicit allowlist that already represents the same access:channels.<id>.groupAllowFromchannels.<id>.commandGroupAllowFromchannels.<id>.groupOwnerAllowFromcommands.allowFrom.<channel-id>tools.elevated.allowFrom.<channel-id>The goal is preservation: when a later channel PR disables a fallback in code, users keep the same effective access after doctor copies the old
allowFromvalues to the correct explicit target.Future Channel PR Checklist
For each fallback a channel later disables, that channel PR must do both:
false.Doctor infers the copy target from the boolean:
falseallowFromtoallowFromgroupAllowFromFallbackToAllowFromchannels.<id>.groupAllowFromcommandGroupAllowFromFallbackToAllowFromchannels.<id>.commandGroupAllowFromallowFromgroupOwnerAllowFromFallbackToAllowFromchannels.<id>.groupOwnerAllowFromallowFromcommandAllowFromFallbackToAllowFromcommands.allowFrom.<channel-id>allowFromelevatedAllowFromFallbackToAllowFromtools.elevated.allowFrom.<channel-id>Only set a fallback boolean to
falseafter the target config key is accepted by that channel schema and actually read by that channel runtime. Multi-account channels must preserve account scope; otherwise doctor warns instead of copying into a broader provider target.Example: future Telegram opt-out
A later Telegram PR that disables group-sender fallback would set the same capability in two places:
The runtime flag changes live authorization behavior. The package metadata lets
openclaw doctor --fixpreserve existing configs without loading Telegram runtime.When that future PR lands, doctor can copy:
{ "channels": { "telegram": { "allowFrom": ["123456789"] } } }to:
{ "channels": { "telegram": { "allowFrom": ["123456789"], "groupAllowFrom": ["123456789"] } } }This PR only adds that generic machinery; it does not set the Telegram runtime flag or package metadata.
Summary
openclaw doctor --fixpreservation-copy repair.Verification
pnpm test src/config/allowfrom-fallback-transition.test.ts src/config/materialize.test.ts src/commands/doctor/channel-capabilities.test.ts src/commands/doctor/shared/empty-allowlist-policy.test.ts src/commands/doctor/repair-sequencing.test.ts src/channels/plugins/read-only.test.ts -- --reporter=verbosepnpm test src/commands/doctor/repair-sequencing.test.ts src/commands/doctor/shared/empty-allowlist-policy.test.ts src/commands/doctor/shared/preview-warnings.test.ts src/config/allowfrom-fallback-transition.test.ts src/config/materialize.test.ts -- --reporter=verbosepnpm test src/config/allowfrom-fallback-transition.test.ts src/config/materialize.test.ts src/commands/doctor/repair-sequencing.test.ts src/commands/doctor/shared/empty-allowlist-policy.test.ts src/commands/doctor/shared/empty-allowlist-scan.test.ts src/commands/doctor/shared/open-policy-allowfrom.test.ts src/commands/doctor/shared/preview-warnings.test.ts src/commands/doctor/channel-capabilities.test.ts src/commands/doctor-config-flow.test.ts src/auto-reply/command-control.test.ts src/auto-reply/reply/reply-elevated.test.ts src/plugin-sdk/channel-ingress-runtime.test.ts src/channels/plugins/read-only.test.ts src/security/dm-policy-shared.test.ts -- --reporter=verbosepnpm docs:listpnpm check:changedbefore rebasegit diff --check origin/main...HEADKnown after rebase:
pnpm check:changedcurrently fails in untouchedsrc/agents/pi-embedded-runner/run/helpers.test.tswith an upstream-mainUsageAccumulatortype error. The file is identical toorigin/main.