Skip to content

[Feature]: System agent overhaul: shared chat UI, config change journal, durable history, agentic identity #110896

Closed

Description

@steipete

Summary

Overhaul the OpenClaw system agent ("Ask OpenClaw" / Setup chat): reuse the regular chat's presentation layer, add a durable config change journal (including manual-edit detection), persist the conversation, and make the greeting agentic with a real system identity.

Problem to solve

The custodian Control UI surface hand-rolls its own message bubbles, thinking indicator, markdown pipeline, and composer (ui/src/pages/custodian/custodian-page.ts + ui/src/styles/custodian.css), so it looks worse than the regular chat and duplicates code the chat page already owns. Beyond looks:

  • Operators cannot review what changed on their system. The system agent's audit trail (src/system-agent/audit.ts) is write-only — no read path — and it only covers system-agent writes. Manual openclaw.json edits, doctor migrations, Settings-UI patches, and CLI edits leave no reviewable history.
  • The conversation is ephemeral by design (process-local 8-session LRU, src/gateway/server-methods/system-agent.ts), so an admin can't revisit yesterday's setup exchange.
  • The greeting is a static template bullet wall (src/system-agent/overview.ts), suggested commands render as inline code the user has to retype, and the agent has no identity, update awareness, or status personality.

Proposed solution

Five independent phases, one PR each:

  1. UI dedup — render custodian messages through the chat page's renderMessageGroup + .chat-group styles and reuse chat composer styling; delete the bespoke rendering. Keep the custodian-owned state machine (connection scoping, idempotent-retry rule, sensitive masking, option cards, event nudges).
  2. Config change journal — generalize the system-agent audit store into a source-labeled journal appended at the shared config write path (system-agent, doctor, config-rpc, cli, plugin-install). The existing config hot-reload watcher classifies filesystem changes with no matching internal-write hash as external (manual edits) and records key-path diffs via diffConfigPaths; a single-slot redacted config snapshot enables startup reconciliation for offline edits, including "manual edit made config invalid" entries. Secrets stay path-only via existing redaction.
  3. Journal reader — additive operator.admin RPC + change cards in the custodian UI ("what changed on my system, when, by whom").
  4. Durable transcript — move custodian sessions from the process-local LRU into an additive table in the shared state DB as one rolling thread with bounded retention. The engine history is already secret-masked before persistence-eligible; nothing sensitive is stored.
  5. Agentic greeting + identity — deterministic probes produce a typed facts snapshot (config validity, gateway health, update.status, channel health); a model phrases the greeting in the OpenClaw system's voice, cached by snapshot hash (zero tokens on unchanged state, template fallback when inference is unavailable — the rescue path never depends on a model). Suggested commands become tappable structured-question chips.

Alternatives considered

  • Reusing the full openclaw-chat-pane for the custodian: rejected — it binds the rescue path to the sessions/runs machinery, threads ~60 session-coupled props, and the custodian transport is a request/response RPC shared by macOS onboarding, Android, and the TUI.
  • Hash-only manual-edit detection (store a SHA, flag mismatches): subsumed — the watcher's internal-write hash matching plus a redacted snapshot yields real key-path diffs instead of "something changed".
  • Making the custodian a regular agent session for persistence: rejected — regular transcripts persist raw turns; the custodian needs masked-only persistence and must work when agent infra is down.

Impact

All Control UI operators (plus macOS/Android/TUI onboarding surfaces for the backend phases). The journal answers the most common ops mystery — "who broke the config and when" — including hand edits made while the gateway was offline. openclaw.chat shipped only in v2026.7.2-beta tags, so surface changes carry no stable-release compat burden; protocol changes stay additive regardless.

Activity

  1. added
    enhancement
    on Jul 18, 2026
  2. added
    maintainer
    on Jul 18, 2026
  3. added
    P3
    impact:session-state
    impact:other
    issue-rating: 🌊 off-meta tidepool
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    on Jul 18, 2026
  4. clawsweeper commented on Jul 18, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep this protected maintainer issue open: all five phases shipped, but include-only edits still bypass change-history admission and need an owner-approved follow-up scope.

    Reproducibility: Current source establishes that an unchanged root file skips live and startup external-edit records after an include-only edit; no runtime reproduction or tests were run.

    Root-cause cluster
    Relationship: canonical
    Canonical: #110896
    Summary: The five merged phase PRs implement distinct parts of this umbrella; no narrower owner for the remaining include-aware journal coverage was established.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Maintainer decision needed

    • Question: Should this issue be narrowed to include-aware change history, or should that remaining work move to a focused follow-up before the umbrella is retired?
    • Recommendation: Narrow this issue to remaining journal coverage: Mark the five shipped phases complete and retain include-only live and offline change-history coverage here; require concrete failure evidence before expanding duplicate suppression.
    • Why: The five named phases shipped, but the journal implementation deferred further guarantees and current policy accepts rare diagnostic duplicates; only the feature owner can settle the remaining scope.

    Next step
    The feature owner should mark the shipped phases complete and decide where include-only journal coverage belongs, preserving the protected no-new-fix-pr routing.

    Review details

    Best possible solution:

    Retain the shipped rescue-chat design and extend the existing journal to cover include-only changes while preserving bounded, redacted records and accepted diagnostic limits.

    Do we have a high-confidence way to reproduce the issue?

    Current source establishes that an unchanged root file skips live and startup external-edit records after an include-only edit; no runtime reproduction or tests were run.

    Is this the best way to solve the issue?

    The phased implementation preserves the rescue boundary; remaining coverage belongs in the existing config journal and source owner, with a failing include-only regression established before choosing storage changes.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Include-aware persisted journal identity and its upgrade behavior have not been designed or exercised in this review.

    Codex review notes: model internal, reasoning medium; reviewed against e98a15b7d695.

    Label changes

    Label changes:

    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • remove impact:session-state: Current review impact labels are impact:other.
    • remove issue-rating: 🌊 off-meta tidepool: Current issue advisory state no longer selects this label.

    Label justifications:

    • P3: The main feature program has shipped; remaining diagnostic coverage has no demonstrated urgent outage.
    • impact:other: Omitted include-only changes reduce the completeness of operator configuration history.
    Evidence reviewed

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 12, 2026, 9:53 AM ET / 13:53 UTC.

  5. added
    clawsweeper:needs-product-decision
    and removed
    clawsweeper:needs-product-decision
    on Aug 2, 2026
  6. added and removed
    clawsweeper:needs-maintainer-review
    on Aug 16, 2026
  7. added
    clawsweeper:source-repro
    issue-rating: 🦞 diamond lobster
    and removed
    impact:session-state
    issue-rating: 🌊 off-meta tidepool
    on Oct 12, 2026
  8. jonathanlindsay commented on Oct 22, 2026

    @jonathanlindsay
    Contributor

    Two small requests for the greeting/identity phase, from a product that embeds the Control UI under its own name:

    1. A host-settable name for the system agent. The greeting hard-codes "Hi, I'm OpenClaw — caretaker of this gateway, config, channels, and agents." (src/system-agent/overview.ts:318 on main; same text in 2026.10.10-beta.2). An app that ships OpenClaw inside its own product has no way to have the caretaker introduce itself under that product's name, so its users meet a name they never installed. A config key (for example agents.defaults.systemAgent.displayName, defaulting to "OpenClaw") that the greeting and the panel title read would cover it.

    2. "Agent:" instead of "Default agent:" for a requester-owned consult. When another agent consults the system agent, the overview's owner is the requester ("an explicit request agentId always wins ... Delegated consults with a requesting agent keep that requester as their owner", docs/gateway/config-agents/heartbeat-compaction-and-streaming.md), but the greeting still prints Default agent: <requester> (overview.ts:224, :326). Users read that as the install's default agent changing. Labelling it "Agent:" (or "Asked by:") when the owner is the requester, and "Default agent:" only when it really is agents.defaults, would avoid the confusion.

    Happy to open a PR for either if that helps.

  9. steipete commented on Oct 24, 2026

    @steipete
    ContributorAuthor

    Thanks for filing this. We're closing older issues that no longer look actionable on current main.

    All five phases of the system agent overhaul have shipped on main. The remaining include-aware change history and the new host-settable system-agent name request should each be tracked as a fresh, focused issue.

    OpenClaw has changed a lot since this was filed. If this still affects you on the latest release, please open a fresh issue with your version and repro steps (feel free to link back here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3clawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproenhancementimpact:otherissue-rating: 🦞 diamond lobstermaintainer

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions