Skip to content

feat(claws): separate portable and OpenClaw profiles - #112773

Merged
giodl73-repo merged 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/claws-pr14-portable-agent-settings
Jul 24, 2026
Merged

giodl73-repo merged 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/claws-pr14-portable-agent-settings

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep CLAW.md and grouped JSON portable: the agent object contains only id, name, description, and identity presentation.
  • Define metadata as a string-to-string map, following the Agent Skills portability precedent.
  • Move OpenClaw-specific per-agent policy into a strict package-local YAML profile referenced by metadata.openclaw.config.
  • Export the conventional profiles/openclaw.yml path while treating the metadata pointer, not the filename, as normative.
  • Validate the sidecar as bounded JSON-compatible YAML with forward-slash package-relative pointers and no links, aliases, merge keys, tags, duplicate keys, unknown fields, or unsupported schema versions.
  • Bind the exact sidecar path and bytes into local-development integrity, and preserve it through inspect, add, update, provenance, and export.

The profile exists only inside the Claw package. It is consumed while planning the new agent and is never copied to OpenClaw's ordinary configuration path.

This is the final implementation slice after #111391. It implements the portability boundary in RFC PR #48, building on Claws RFC #27.

Policy boundary

The portable core remains harness-agnostic. OpenClaw recognizes openclaw.config; other harnesses may ignore it or define their own namespaced metadata pointer. Host policy remains authoritative. The OpenClaw profile cannot carry custom profile definitions, providers, credentials, bindings, local paths, arbitrary executable configuration, or settings that relax host confinement.

Real behavior proof

  • Missing, empty, escaping, symlinked, hardlinked, oversized, malformed, schema-invalid, and non-portable profile pointers fail before planning.
  • A profile byte change changes local-development integrity.
  • Add and update consume the same validated profile snapshot.
  • Export writes core identity to CLAW.md, writes OpenClaw policy to profiles/openclaw.yml, and includes the sidecar in derivative version hashing.
  • Inspect JSON reports the validated OpenClaw profile without mutating lifecycle state.
  • Lifecycle fixtures prove the referenced profile is consumed by inspect and add.
  • Existing built-in profile, capability-consent, memory, and host-policy behavior remains enforced.

Validation

  • 82 focused schema, profile, capability-change, and export tests pass.
  • 8/8 lifecycle E2E tests pass.
  • Full pnpm check:test-types passes.
  • Oxlint reports 0 warnings and 0 errors on changed files.
  • Formatting and git diff --check pass.
  • Final Codex review reports no actionable findings.
  • Signed head: d255a128a23.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M maintainer Maintainer-authored PR labels Jul 22, 2026
@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr13-claw-md branch 3 times, most recently from 5b21b29 to 6ffd2ed Compare July 23, 2026 01:04
@giodl73-repo
giodl73-repo deleted the branch openclaw:main July 23, 2026 01:37
@giodl73-repo giodl73-repo reopened this Jul 23, 2026
@giodl73-repo
giodl73-repo changed the base branch from user/giodl/claws-pr13-claw-md to main July 23, 2026 02:21
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes labels Jul 23, 2026
@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr14-portable-agent-settings branch from b5c2836 to f67124c Compare July 23, 2026 02:21
@openclaw-barnacle openclaw-barnacle Bot removed gateway Gateway runtime cli CLI command changes labels Jul 23, 2026
@omarshahine omarshahine self-assigned this Jul 23, 2026
@omarshahine

Copy link
Copy Markdown
Contributor

This adds portable Claw tool and memory policy, export support, and update-consent classification. The policy belongs in the Claw owner, but the current implementation crosses the canonical config boundary incorrectly and can miss required capability consent.

LOC: +347/-15 (9 files)

Findings

  1. Blocking: translate portable memory settings to the canonical runtime config shape.

    The manifest exposes agent.memorySearch, but buildClawAddPlan copies the portable agent verbatim into persisted config at src/claws/lifecycle.ts:566. Valid per-agent OpenClaw config stores this under memory.search (src/config/types.agents.ts:125-128), and the old memorySearch key is explicitly dead config.

    The mismatch also affects src/claws/export.ts:89-100 and src/claws/update-capability-changes.ts:330-352: export cannot preserve canonical memory state, update compares nonexistent fields, and the hardcoded inherited defaults diverge from the canonical memory resolver.

    Please add explicit manifest-to-config and config-to-manifest conversion at the Claw boundary, reuse a narrow canonical effective-memory resolver for update classification, and cover validated add/update/export behavior.

  2. Blocking: adding tools.alsoAllow is classified as a reduction.

    src/claws/update-capability-changes.ts:114-128 groups additive alsoAllow with restrictive allow. For an existing agent, undefined -> ["cron"] returns reduction, so requiresDistinctConsent is false even though tool access increased. The added mixed test supplies alsoAllow but never asserts its change record.

    Give alsoAllow additive polarity, resolve inherited values, and add focused unset-to-value, value-to-unset, and mixed-set tests.

  3. Blocking: tools.fs.workspaceOnly: false can disable host-wide confinement.

    src/claws/schema.ts:94 accepts either boolean and the lifecycle persists it directly. Runtime intentionally gives the agent value precedence over the global setting at src/agents/tool-fs-policy.ts:21-30, so a Claw can turn a global workspaceOnly: true into false. That contradicts the linked RFC's host-upper-bound guarantee.

    The bounded fix is to make the portable declaration literal true only and let omission inherit host policy. Otherwise the RFC needs an explicit owner decision that this setting is overrideable.

  4. High: compare effective tool/filesystem capabilities, not raw field values.

    Profile comparison ignores inherited global profiles, and full resolves to ["*"] before literal set comparison at src/claws/update-capability-changes.ts:192-202, so full -> coding is mislabeled an escalation. The generic undefined handling also runs before workspace-specific semantics, producing incorrect results for inherited filesystem transitions.

    Please compare current and desired policy through canonical runtime resolvers, model wildcard containment, and add inherited-profile, full -> coding, and unset-to-workspaceOnly: true coverage.

Best-fix verdict: wrong boundary for memory configuration and incomplete capability semantics. This is not merge-ready yet. The clean fix is a small Claw-owned portable/canonical adapter plus shared effective-policy comparison, not additional field-specific heuristics.

Code read: changed Claw schema/lifecycle/export/update modules and tests; config types and strict schema; memory resolver and memory-host defaults; tool profile, allow/deny, wildcard, and filesystem policy owners; current origin/main.

Remaining uncertainty: the PR is draft and the meaningful typecheck, test, build, and CI-gate lanes are skipped. I did not execute contributor-controlled code locally.

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr14-portable-agent-settings branch 2 times, most recently from 288ed14 to 33605d4 Compare July 23, 2026 04:44
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Addressed the independent review findings at signed head 33605d4b0df: the portable contract now uses canonical agent.memory.search with no experimental alias; update classification resolves inherited profiles/filesystem defaults, handles the full wildcard and alsoAllow additions/removals, and avoids duplicate profile changes. Proof: 73 focused tests, production typechecks, Oxlint clean, 36/36 downstream ClawHub bridge tests, and final codex review --commit HEAD with no actionable regressions.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Addressed all four findings at signed head 631964673ee:

  • portable memory uses canonical agent.memory.search, and update classification now calls OpenClaw's contextual resolveRememberAcrossConversations resolver instead of copying a default;
  • alsoAllow has additive polarity with focused add/remove/mixed coverage;
  • portable tools.fs.workspaceOnly is now literal true only, export omits false, and validation rejects attempts to relax host confinement;
  • profile/filesystem comparisons resolve inherited effective policy and wildcard containment.

The restrictive-only and canonical-resolver requirements are also normative in RFC #48 at signed head d06703f.

Proof: 75/75 focused tests, production core/UI/extensions typechecks, zero targeted Oxlint findings, full docs formatting/lint/MDX checks, git diff --check, and a clean unsandboxed Codex review that independently reran the 75 tests.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Addressed all three independent review findings at signed head 8f7e1afa6ec8:

  • migrated lifecycle fixtures to package-local OpenClaw profile pointers and asserted inspect/add consume them;
  • removed unsupported heartbeat.skipWhenBusy from the profile contract;
  • rejected backslashes in metadata.openclaw.config so the pointer is portable across hosts.

Validation: 82 focused tests, 8/8 lifecycle E2E, full test typecheck, targeted Oxlint, formatting/diff checks, and a clean final Codex review. The two remaining CI failures are unrelated current-base iOS release deadcode/test-routing failures.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr14-portable-agent-settings branch from 8f7e1af to 32d9929 Compare July 24, 2026 00:16
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Rebased the six signed commits cleanly onto current upstream/main at 32d9929923e, removing the stale-base iOS CI failures. Revalidation passed: 82/82 focused tests, 8/8 lifecycle E2E, full test typecheck, targeted Oxlint, and diff checks.

The final review also considered two exporter combinations (allow plus alsoAllow, and sessions without the portable opt-in). They are unreachable at profile generation: export requires an installed Claw whose agent config still matches provenance; invalid profiles cannot be installed, and later edits fail as agent_drifted before export.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr14-portable-agent-settings branch from 32d9929 to d255a12 Compare July 24, 2026 01:02
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Rebased cleanly onto current main including the iOS test-routing CI fix. Signed head d255a128a23 passes 82/82 focused tests, the exact previously failing 220/220 test-project routing suite, 8/8 lifecycle E2E, full test typechecking, and diff checks. No Claws-owned failure remains. @clawsweeper re-review

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr14-portable-agent-settings branch from d255a12 to 29f58e4 Compare July 24, 2026 03:13
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (61f036f748645952487ca35d280a1905665af766) and force-with-lease pushed current head 29f58e4965a5671f280d4fde506b4f03d56efd5b.

Scoped current-head proof:

  • git diff --check origin/main...HEAD
  • scoped pnpm exec oxfmt --check for the Claws/docs changed files
  • scoped pnpm exec oxlint --deny-warnings --tsconfig tsconfig.json for the Claws/CLI TypeScript changed files
  • node scripts/run-vitest.mjs src/claws/schema.test.ts src/claws/openclaw-profile.test.ts src/claws/export.test.ts src/claws/provenance.test.ts src/claws/update-capability-changes.test.ts --run (109 tests)
  • node scripts/run-vitest.mjs src/claws/lifecycle.e2e.test.ts --run (8 lifecycle E2E tests)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Rebased again onto current main (edc344834ba0f4e3b561c8919cf84bdd50ff8b8b) after the auth-profile migration fix landed, and force-with-lease pushed current head b7dd7c0b7c1b87d8ba4a370bb89dcde56f01c9fa.

Scoped current-head proof:

  • git diff --check origin/main...HEAD
  • scoped pnpm exec oxfmt --check for the Claws/docs changed files
  • scoped pnpm exec oxlint --deny-warnings --tsconfig tsconfig.json for the Claws/CLI TypeScript changed files
  • node scripts/run-vitest.mjs src/claws/schema.test.ts src/claws/openclaw-profile.test.ts src/claws/export.test.ts src/claws/provenance.test.ts src/claws/update-capability-changes.test.ts --run (109 tests)
  • node scripts/run-vitest.mjs src/claws/lifecycle.e2e.test.ts --run (8 lifecycle E2E tests)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@giodl73-repo
giodl73-repo force-pushed the user/giodl/claws-pr14-portable-agent-settings branch from b7dd7c0 to f50a918 Compare July 24, 2026 18:46
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (ab5e2c34efd1af0a1f47591a46a48a9257f15020) and force-with-lease pushed current head f50a918af102b950721c1b380f7eb8af4e0389d1.

Scoped current-head proof:

  • git diff --check origin/main...HEAD
  • scoped ./node_modules/.bin/oxfmt --check for the Claws/docs changed files
  • scoped ./node_modules/.bin/oxlint --deny-warnings --tsconfig tsconfig.json for the Claws/CLI TypeScript changed files
  • node scripts/run-vitest.mjs src/claws/schema.test.ts src/claws/openclaw-profile.test.ts src/claws/export.test.ts src/claws/provenance.test.ts src/claws/update-capability-changes.test.ts --run (109 tests)
  • node scripts/run-vitest.mjs src/claws/lifecycle.e2e.test.ts --run (8 lifecycle E2E tests)

No code changes beyond the clean rebase.

@giodl73-repo
giodl73-repo merged commit e9b3252 into openclaw:main Jul 24, 2026
117 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 25, 2026
* feat(claws): add portable agent policy settings

* fix(claws): align portable agent policy

* fix(claws): preserve host policy boundaries

* feat(claws): separate portable and OpenClaw profiles

* test(claws): align profile fixtures with portable schema

* fix(claws): align portable profile boundaries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants