You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Target area: AutoSkill4OpenClaw/adapter/embedded_runtime.js, AutoSkill4OpenClaw/adapter/embedded_runtime.test.mjs, and embedded user docs.
Objective: reduce the risk of embedded mirror installs overwriting user-owned OpenClaw local skill folders, and improve operator visibility when name conflicts happen.
Completed
Hardened embedded mirror behavior:
embedded mirror directories now write .autoskill-managed.json
only AutoSkill-managed mirror folders are overwritten in place
if a same-name non-managed local skill folder already exists, AutoSkill now falls back to a suffixed mirror directory such as <name>-autoskill
Added a warning log when embedded mirror has to choose a suffixed destination because of an existing non-managed folder.
Added regression coverage in AutoSkill4OpenClaw/adapter/embedded_runtime.test.mjs:
verifies an existing user-owned local skill directory is preserved
verifies AutoSkill mirrors into a safe suffixed folder instead
verifies the managed marker file is written
Updated embedded README docs in both languages:
documented the non-overwrite behavior for existing local skill folders
documented .autoskill-managed.json as the ownership marker for embedded mirror directories
This change stays strictly inside the embedded mirror path and does not affect:
memory / compaction / tools / provider behavior
sidecar runtime behavior
skill retrieval injection behavior
The fallback-to-suffixed-directory behavior is intentionally conservative: preserving an existing user-owned folder is safer than forcing a same-name overwrite.
Remaining Issues / Risks
Embedded extraction still depends on the host OpenClaw deployment actually invoking the adapter lifecycle hooks.
Live checkpoint extraction is still best-effort in memory across a running process; after a host restart, checkpoint progression resumes from subsequent turns rather than from a persisted checkpoint cursor.
Embedded mirror still uses directory-name heuristics rather than a full manifest-based per-skill mapping like the Python-side mirror manager.
Next Step
Continue with operator-focused hardening:
improve visibility around model invocation fallback failures in real deployments
evaluate whether embedded mirror should adopt a manifest-backed folder mapping similar to the Python mirror path
keep pruning/cleanup logic conservative and fail-open
2026-04-08 - Round 33 (embedded live checkpoint extraction)
Scope
Target area: AutoSkill4OpenClaw/adapter/embedded_runtime.js, AutoSkill4OpenClaw/adapter/index.js, installer/config surfaces, and embedded docs/tests.
Objective: stop waiting for session end in embedded mode by adding periodic live extraction on active sessions, while keeping closed-session extraction and recovery intact.
Completed
Added embedded live checkpoint extraction:
new embedded config liveExtractEveryTurns
default value 5
runs one extraction/maintenance pass every N turns for an active embedded session without closing the session
Reused the existing embedded extraction/maintenance pipeline instead of creating a second skill-writing path:
live checkpoints read the current session JSONL archive
extraction still goes through the same candidate generation and maintenance decision flow
mirror/store-only behavior is unchanged
Added live checkpoint dedupe in memory so the same session checkpoint is not reprocessed repeatedly on every subsequent turn.
Fixed a real recovery/dedupe bug discovered during this work:
startup recovery could reprocess a just-closed session because recovery items had empty session_id while normal queue items had populated session_id
closed-session ledger keys are now normalized by file path, so recovery and live closure processing agree on identity
legacy processed-ledger entries are normalized on load to remain compatible
Updated config and delivery surfaces:
AutoSkill4OpenClaw/adapter/openclaw.plugin.json
AutoSkill4OpenClaw/install.py
AutoSkill4OpenClaw/.env.example
AutoSkill4OpenClaw/tests/test_install.py
AutoSkill4OpenClaw/adapter/index.test.mjs
Updated embedded READMEs in both languages:
documented liveExtractEveryTurns
clarified the difference between live checkpoint extraction and closed-session extraction
expanded troubleshooting for “embedded sessions have data but SkillBank is empty”
closed-session extraction, startup recovery, and mirror/install behavior remain intact
The change stays inside AutoSkill4OpenClaw and does not touch OpenClaw core, memory, compaction, tools, or provider wiring.
Remaining Issues / Risks
Embedded extraction still depends on the host OpenClaw deployment actually invoking the adapter lifecycle hooks.
Live checkpoint extraction is best-effort in memory across a running process; after a host restart, checkpoints resume from the next observed live turn rather than restoring an exact prior checkpoint cursor.
Mirrored skill identity/conflict protection can still be hardened further before enabling more aggressive automated pruning or overwrite behavior.
Next Step
Continue with embedded runtime hardening:
add mirrored-skill conflict guardrails
improve visibility around model invocation fallback failures in real deployments
keep pruning/cleanup logic conservative and fail-open
Target area: AutoSkill4OpenClaw/adapter/embedded_runtime.js, AutoSkill4OpenClaw/adapter/embedded_runtime.test.mjs, and embedded runtime docs.
Objective: fix a real embedded-mode gap where session files could be closed into embedded_sessions but never reach extraction/maintenance, leaving SkillBank empty.
Completed
Identified the root issue in embedded mode:
before_prompt_build used stageLive(...) to append/archive session data
when stageLive(...) closed a previous session because of session_id change or sessionMaxTurns, it only wrote closed files and returned metadata
extraction/maintenance only ran in handle(...) / agent_end, so those closed sessions could be stranded in embedded_sessions
The main behavior change is only that a session closed during before_prompt_build no longer waits for a later agent_end that may never process that already-closed archive.
Remaining Issues / Risks
Embedded extraction still depends on at least one successful turn_type=main in the closed session.
If the embedded model invocation fallback chain cannot resolve any usable runtime/config/manual target, sessions will close correctly but extraction will still fail; the new logs now make that visible.
Mirrored skill identity/conflict protection can still be hardened further before enabling more aggressive automated pruning or overwrite behavior.
Next Step
Continue with embedded runtime hardening:
add mirrored-skill conflict guardrails
improve troubleshooting visibility around model invocation fallback failures
keep pruning/cleanup logic conservative and fail-open
Objective: remove the GitHub Actions workflow that was added during delivery hardening but should not be part of the submitted OpenClaw plugin changes.
Completed
Removed .github/workflows/autoskill4openclaw-ci.yml from the repository.
Kept all AutoSkill4OpenClaw code, tests, docs, and runtime changes intact.
This round only removed repository-level CI metadata and did not change runtime behavior, plugin hooks, extraction logic, or documentation outside the status log.
Remaining Issues / Risks
Embedded mode still depends on the host OpenClaw deployment actually executing lifecycle hooks such as before_prompt_build and agent_end.
The runtime still depends on a local repository checkout and is not yet packaged as a standalone distributable for AutoSkill4OpenClaw.
Mirrored skill identity/conflict protection can still be hardened further before enabling more aggressive automated pruning or overwrite behavior.
Next Step
Continue with delivery-focused runtime hardening only:
add mirrored-skill conflict guardrails
add one lightweight real-runtime smoke scenario for OpenClaw deployment boundaries
keep pruning/cleanup logic conservative and fail-open
Target area: AutoSkill4OpenClaw/tests/test_install.py, AutoSkill4OpenClaw/README.md, AutoSkill4OpenClaw/README.zh-CN.md, top-level README.md, and CI coverage.
Objective: tighten delivery confidence by verifying entrypoint scripts actually start, clarifying runtime prerequisites/checkout assumptions, and aligning the top-level project documentation with the current embedded-first OpenClaw integration path.
Completed
Added CLI smoke coverage in AutoSkill4OpenClaw/tests/test_install.py:
install.py --help must execute successfully
run_proxy.py --help must execute successfully
this guards against import-path regressions and broken entrypoint wiring that unit tests alone could miss
Improved plugin READMEs:
documented that Node.js is only needed for adapter tests / local verification scripts
documented that curl is only needed for the optional sidecar verification script
documented that the local repository checkout must remain on disk after installation because runtime scripts still reference AutoSkill4OpenClaw/run_proxy.py
Updated top-level README.md:
repository structure now describes AutoSkill4OpenClaw/ as embedded-first OpenClaw integration instead of a sidecar-only plugin
the OpenClaw quick-install example now reflects the recommended embedded-first path
top-level docs now explicitly state that the sidecar path is optional and not required for the recommended mainline
Added lightweight GitHub Actions coverage in .github/workflows/autoskill4openclaw-ci.yml:
install package with pip install -e .
run python -m unittest discover -s AutoSkill4OpenClaw/tests -q
The new CI/workflow coverage is intentionally narrow and focused on the OpenClaw integration surface instead of trying to validate the whole repository at once.
Remaining Issues / Risks
Embedded mode still depends on the host OpenClaw deployment actually executing lifecycle hooks such as before_prompt_build and agent_end.
The runtime still depends on a local repository checkout and is not yet packaged as a standalone distributable for AutoSkill4OpenClaw.
Mirrored skill identity/conflict protection can still be hardened further before enabling more aggressive automated pruning or overwrite behavior.
Next Step
Continue with final delivery-risk reduction:
add mirrored-skill conflict guardrails
add one lightweight real-runtime smoke scenario for OpenClaw deployment boundaries
keep pruning/cleanup logic conservative and fail-open
2026-03-15 - Round 29 (pre-delivery env and naming audit)
Scope
Target area: AutoSkill4OpenClaw/.env.example, AutoSkill4OpenClaw/install.py, AutoSkill4OpenClaw/tests/test_install.py, and plugin README naming/compatibility notes.
Objective: close pre-delivery gaps around environment-template drift, false-positive coverage tests, and naming clarity between the repo, adapter id, and sidecar runtime install paths.
Completed
Fixed environment template drift:
refreshed AutoSkill4OpenClaw/.env.example so it includes the full current AutoSkill/OpenClaw adapter env surface instead of only the older reduced subset
added embedded runtime envs such as:
AUTOSKILL_OPENCLAW_RUNTIME_MODE
AUTOSKILL_OPENCLAW_EMBEDDED_SESSION_DIR
AUTOSKILL_OPENCLAW_EMBEDDED_SESSION_MAX_TURNS
AUTOSKILL_OPENCLAW_EMBEDDED_MODEL_MODES
AUTOSKILL_OPENCLAW_EMBEDDED_MANUAL_*
added compatibility/fallback envs used by adapter code such as:
AUTOSKILL_BASE_URL
AUTOSKILL_PROXY_BASE_URL
AUTOSKILL_DOTENV
AUTOSKILL_MAX_INJECTED_CHARS
AUTOSKILL_SKILLBANK_DIR
AUTOSKILL_REPO_SKILLBANK_DIR
AUTOSKILL_PROXY_MODELS
Fixed generated installer .env output in AutoSkill4OpenClaw/install.py so fresh installs receive the same expanded env surface as the checked-in example file.
Tightened regression coverage in AutoSkill4OpenClaw/tests/test_install.py:
the env-example audit now parses exact env keys instead of using substring matching
the audit now checks env usage across run_proxy.py, adapter/index.js, and adapter/embedded_runtime.js
this closes a real false-positive gap where AUTOSKILL_PROXY_MODELS was previously considered covered by AUTOSKILL_PROXY_MODELS_JSON
Improved naming clarity in both plugin READMEs:
documented that the repo/project name is AutoSkill4OpenClaw
documented that the adapter id remains autoskill-openclaw-adapter
documented that the optional sidecar runtime install dir remains ~/.openclaw/plugins/autoskill-openclaw-plugin
explicitly called out that these runtime/install identifiers are retained for compatibility
This round intentionally focused on low-risk delivery hardening:
no runtime extraction logic changed
no OpenClaw hook behavior changed
no memory/provider/tool path changed
The env-template/test fix matters because it catches drift that would otherwise only appear during deployment or manual configuration.
Remaining Issues / Risks
Embedded mode still depends on the host OpenClaw deployment actually executing lifecycle hooks such as before_prompt_build and agent_end.
The repository still assumes a local checkout for AutoSkill4OpenClaw runtime scripts rather than packaging it as a standalone Python distribution module.
Mirrored skill identity/conflict protection can still be hardened further before enabling any more aggressive automated pruning.
Next Step
Continue with delivery-focused hardening:
add stronger mirrored-skill conflict guardrails
add a lightweight real-runtime smoke check
keep usage-based pruning conservative and fail-open
2026-03-15 - Round 28 (installer and schema alignment for embedded mainline)
Scope
Target area: AutoSkill4OpenClaw/install.py, AutoSkill4OpenClaw/.env.example, AutoSkill4OpenClaw/adapter/openclaw.plugin.json, and plugin README alignment.
Objective: close delivery gaps where the documented embedded-first setup was not fully reflected in installer defaults, environment templates, or plugin config schema.
Completed
Fixed installer defaults in AutoSkill4OpenClaw/install.py:
openclaw.json upsert now writes embedded-first defaults when values are absent:
runtimeMode=embedded
openclawSkillInstallMode=openclaw_mirror
embedded directories for skillBankDir, openclawSkillsDir, and sessionArchiveDir
embedded.sessionMaxTurns=20
installer now creates ~/.openclaw/autoskill/embedded_sessions
generated .env template now includes AUTOSKILL_OPENCLAW_SESSION_MAX_TURNS=20
installer wording now describes the runtime/adapter installation more accurately instead of calling it only a sidecar installer
Fixed plugin schema drift in AutoSkill4OpenClaw/adapter/openclaw.plugin.json:
added missing embedded.sessionMaxTurns
added missing embedded.promptPackPath
refreshed adapter description so it reflects embedded + sidecar support
Unified bare adapter defaults with the embedded-first product path:
AutoSkill4OpenClaw/adapter/index.js now defaults runtimeMode to embedded
AutoSkill4OpenClaw/adapter/openclaw.plugin.json now defaults runtimeMode to embedded
store_only remains the explicit exception: retrieval auto-injection is still enabled there even under embedded runtime, so non-mirrored setups keep the expected behavior
Refreshed AutoSkill4OpenClaw/.env.example so it matches current runtime options instead of an older reduced variable set.
Updated plugin READMEs:
installer behavior is now documented as writing embedded-first defaults automatically
users only need manual edits for overrides or sidecar switching
Added regression coverage in AutoSkill4OpenClaw/tests/test_install.py:
installer writes embedded defaults
existing explicit runtime/install choices are preserved
env template includes long-session turn limit
.env.example stays aligned with run_proxy.py env keys
plugin manifest schema exposes embedded fields used by code/docs
This round now aligns both installer behavior and bare adapter defaults with the documented embedded-first path, while still preserving explicit user choices already present in openclaw.json.
Existing explicit runtimeMode=sidecar and openclawSkillInstallMode=store_only values are preserved by the installer.
Remaining Issues / Risks
The repository still assumes a local checkout for AutoSkill4OpenClaw runtime scripts rather than packaging it as a standalone Python distribution module.
Embedded mode still depends on the host OpenClaw deployment actually executing lifecycle hooks such as before_prompt_build and agent_end; AutoSkill now has better diagnostics for this, but it cannot force a non-hooked execution path to emit extraction events.
Next Step
Continue with a focused delivery audit:
audit skill identity/conflict handling for mirrored installs
tighten docs around hook-trigger troubleshooting and deployment boundaries
consider a lightweight end-to-end smoke check for real OpenClaw runtime paths
2026-03-15 - Round 27 (long-session auto-checkpoint after 20 turns)
Scope
Target area: AutoSkill4OpenClaw/openclaw_conversation_archive.py, AutoSkill4OpenClaw/adapter/embedded_runtime.js, and related config/docs/tests.
Objective: avoid waiting forever when session_id never changes by auto-closing a long-lived session segment after a safe turn threshold and running one extraction/maintenance pass.
Completed
Added a new session turn-limit safeguard to both runtime paths:
Python sidecar/session-end archive path now supports session_max_turns in OpenClawConversationArchiveConfig
embedded runtime now supports embedded.sessionMaxTurns
Set the default threshold to 20 turns on both paths:
The threshold is intentionally segment-based, not global-session destructive truncation: once a long session segment is closed, the next turn with the same session_id starts a new local segment cleanly.
This is fail-open relative to conversation continuity: it never blocks the live OpenClaw turn; it only affects when AutoSkill decides that the archived evidence is sufficient to attempt extraction.
No memory slot, compaction, provider routing, or OpenClaw core behavior was changed.
Remaining Issues / Risks
A very long multi-topic session can now produce multiple extraction passes instead of a single session-end pass. This is usually preferable to waiting forever, but it can increase maintenance frequency on noisy sessions.
The threshold is a simple turn count today. A future improvement could combine turn count with topic-change heuristics or inactivity signals for cleaner segmentation.
Next Step
Add one more safety layer for generated skill installation:
audit name/identity conflicts between generated SkillBank skills and existing OpenClaw local/native skills
prefer stable conflict detection before considering more aggressive automated pruning
Target area: AutoSkill4OpenClaw/service_runtime.py and AutoSkill4OpenClaw/adapter/embedded_runtime.js.
Objective: improve extraction quality by preserving explicit end-of-session user feedback and by giving the embedded extractor explicit session-level evidence about main turns and success state.
Completed
Audited current extraction-input paths and confirmed a real gap:
agent_end already receives user_feedback, but the session-end extraction path was only archiving raw messages and silently dropping the feedback from the later extraction window.
embedded extraction prompts required turn_type=main evidence, but the extractor only saw merged session_messages, not explicit turn summaries or main/success evidence.
Fixed session-end feedback loss in AutoSkill4OpenClaw/service_runtime.py:
added _append_user_feedback_message(...)
archived conversation records now append explicit user_feedback as a final user message when it adds new evidence
session archive records now do the same, so session-end extraction keeps the strongest user-supplied supervision signal
Improved embedded extraction inputs in AutoSkill4OpenClaw/adapter/embedded_runtime.js:
session archiving now preserves payload.user_feedback in the closed session transcript
loadClosedSession(...) now builds compact session_evidence:
extractCandidate(...) now passes session_evidence into the extractor payload instead of relying only on the flattened message list
Updated shared prompt guidance in AutoSkill4OpenClaw/adapter/openclaw_prompt_pack.txt so the embedded extractor explicitly uses session_evidence when present.
Added regression coverage:
AutoSkill4OpenClaw/tests/test_service_runtime.py
verifies user_feedback is preserved in both archived session data and the scheduled extraction window
This round improves only extraction input fidelity; it does not change retrieval injection, memory behavior, provider/model routing, or OpenClaw core execution.
The feedback append is deduplicated against the last user message to avoid obvious duplicate tails.
session_evidence is intentionally compact and summary-only, so it improves model grounding without duplicating the full transcript payload.
Remaining Issues / Risks
Embedded/session-end extraction is now better grounded, but it still operates on a whole-session view, which is intentionally different from the sidecar main-turn proxy’s main-turn + assistant + next_state sampling granularity.
Explicit user feedback is now preserved only when it is passed in the hook payload; if upstream channels never populate user_feedback, we still depend on the normal message trajectory for supervision.
Next Step
Reconcile and document the strengths/limits of the two extraction timings more explicitly:
embedded/session-end extraction for convenience and stable OpenClaw-native skill evolution
sidecar/main-turn sampling for finer-grained trajectory learning and RL-style data collection
Target area: AutoSkill4OpenClaw/adapter/embedded_runtime.js and prompt pack alignment.
Objective: close the gap between OpenClaw standard skill artifacts and the embedded runtime by preserving extracted scripts/, references/, and assets/ instead of dropping them.
Completed
Audited OpenClaw skill loading/authoring expectations against the current embedded runtime:
confirmed OpenClaw standard skills are directory artifacts with SKILL.md plus optional bundled resources.
confirmed AutoSkill embedded prompts already encouraged resources, but embedded write-paths were silently discarding them.
Implemented bundled resource support in AutoSkill4OpenClaw/adapter/embedded_runtime.js:
added safe normalization for extracted resource paths under scripts/, references/, and assets/
added flexible parsing for optional files/resources payloads from extractor/merge model outputs
preserved bundled resources on add/merge writes into SkillBank
rendered ## Files in generated SKILL.md
loaded existing resource files back from SkillBank during maintenance/BM25 matching
included resource paths in duplicate detection so "same prompt but new reusable files" is no longer skipped
preserved candidate resources during merge even when the merge LLM returns only metadata/prompt fields
Tightened embedded prompt pack alignment in AutoSkill4OpenClaw/adapter/openclaw_prompt_pack.txt:
embedded extraction now explicitly allows concise optional resources/files
embedded merge now explicitly preserves bundled resources when they improve the same capability
Updated embedded docs:
AutoSkill4OpenClaw/README.md
AutoSkill4OpenClaw/README.zh-CN.md
both now explicitly state that generated skills can keep bundled resources in SkillBank and in the OpenClaw mirror
Added regression coverage in AutoSkill4OpenClaw/adapter/embedded_runtime.test.mjs:
extracted bundled resources are written to SkillBank and mirrored to OpenClaw
merge keeps candidate bundled resources even if the merge LLM omits them
duplicate skip test now reflects a true metadata-identical duplicate instead of a candidate with different retrieval metadata
Initial implementation treated any richer candidate description as a meaningful delta, which broke the duplicate-skip regression. Tightened the logic so description-only wording changes no longer bypass duplicate detection.
Initial merge implementation still lost candidate resources when the merge LLM returned JSON without files. Fixed by merging existing.files + candidate.files into the normalization fallback.
Self-Review Notes
This round is intentionally localized to the embedded runtime and shared prompt pack; it does not modify OpenClaw core, memory behavior, provider/model routing, hook registration, or sidecar transport.
Resource paths are constrained to safe relative paths under scripts/, references/, or assets/.
The write-path remains fail-open: if no resources are extracted, behavior stays equivalent to the previous SKILL.md-only flow.
Remaining Issues / Risks
Embedded maintenance now reads existing resource files from SkillBank for matching/preservation, which is correct but adds extra filesystem work per maintenance cycle; it may need a stricter cap if users maintain very large manual skills.
Binary assets are intentionally preserved on disk once written, but embedded maintenance only reads small text-like files back into memory; binary-heavy skills may need a lighter manifest-only path later.
Next Step
Revisit embedded maintenance scoring/prompts with full OpenClaw skill authoring semantics in mind:
decide whether bundled resource paths should also influence add-vs-merge prompting more explicitly
evaluate whether usage-count / stale-skill pruning can safely incorporate mirrored resource-heavy skills without false deletions
2026-03-15 - Round 24 (embedded install docs without provider args)
Scope
Target area: AutoSkill4OpenClaw/README.md and AutoSkill4OpenClaw/README.zh-CN.md.
Objective: make the recommended embedded installation path explicit and remove the impression that users must provide separate LLM/embedding providers.
Completed
Reworked the install section in both plugin READMEs:
added a dedicated "recommended embedded install" subsection
installation command now omits --llm-provider, --llm-model, --embeddings-provider, and --embeddings-model
clarified that embedded mode reuses the existing OpenClaw runtime/model path
clarified that generated .env provider placeholders are optional in embedded mode
clarified that the sidecar process does not need to be started for the recommended embedded path
Kept an explicit optional subsection for sidecar/manual-provider installation so advanced deployments still have a documented path.
Validation
Executed:
cd AutoSkill4OpenClaw/adapter && npm test
Result:
54/54 adapter tests pass.
Self-Review Notes
Docs now match the actual embedded runtime direction: installation is lightweight and does not require users to choose a separate provider stack up front.
No code-path changes were introduced in this round.
2026-03-14 - Round 23 (message_received diagnostics for Feishu ingress)
Scope
Target area: AutoSkill4OpenClaw/adapter/index.js.
Objective: distinguish "channel traffic reached plugin hooks" from "agent lifecycle hooks executed" in Feishu/OpenClaw deployments.
Completed
Added a low-risk diagnostic probe on message_received:
registers message_received alongside existing before_prompt_build and agent_end hooks.
logs first invocation marker:
hook first invocation name=message_received
logs per-event session/channel summary without dumping prompt bodies:
message_received invoked session=... channel=...
Extended lifecycle watchdog logging:
now reports message_received, before_prompt_build, and agent_end counters together.
makes it easy to tell whether Feishu traffic hits plugin hooks at all, or only stops before agent loop.
Updated adapter tests in AutoSkill4OpenClaw/adapter/index.test.mjs:
registration list now includes message_received
diagnostics test now verifies first-invocation and session/channel logging for message_received
Validation
Executed:
cd AutoSkill4OpenClaw/adapter && npm test
Result:
54/54 adapter tests pass.
Self-Review Notes
This change is diagnostic-only and fail-open.
No message mutation, retrieval behavior, memory behavior, or provider/model path was changed.
Remaining Issues / Risks
If message_received still does not fire in production, the issue is below plugin lifecycle registration and likely in deployment/load/runtime boundaries.
If message_received fires but before_prompt_build does not, the message is entering channel dispatch but not reaching runEmbeddedPiAgent(...).
Initial attempt to compare OpenClaw-RL via GitHub web rendering was too noisy for code-level verification.
Switched to a local shallow clone of Gen-Verse/OpenClaw-RL for direct source inspection.
Self-Review Notes
This is a low-risk parser-only change; no memory, provider, hook, or OpenClaw core behavior is modified.
The fix matters because OpenClaw 2026.3.x deployments may omit turn_type, which previously caused the sidecar proxy path to skip all main-turn extraction.
Remaining Issues / Risks
Embedded mode still depends on OpenClaw lifecycle hooks firing; it is not a drop-in replacement for RL-style proxy capture.
session_done is still explicit-field-first; without it, the final pending main turn remains intentionally unextracted unless another close signal arrives.
Next Step
Decide whether embedded mode should remain the default recommendation when reliable RL-style sampling is required.
Objective: lock down no-sidecar env alias behavior and prevent silent mode fallback mistakes.
Completed
Added config regression tests in AutoSkill4OpenClaw/adapter/index.test.mjs:
AUTOSKILL_OPENCLAW_NO_SIDECAR=1 enables runtimeMode=embedded when runtime mode is otherwise unset.
Explicit runtimeMode=sidecar keeps sidecar mode even when no-sidecar alias is set.
Fixed normalizeConfig in AutoSkill4OpenClaw/adapter/index.js:
Treat empty AUTOSKILL_OPENCLAW_RUNTIME_MODE as unset.
Prevent empty-string env from overriding AUTOSKILL_OPENCLAW_NO_SIDECAR=1.
Validation
Executed:
cd AutoSkill4OpenClaw/adapter && npm test
Result:
26 passed, 0 failed.
Failed Attempts
Initial test run failed (25 passed, 1 failed):
Failure: no-sidecar alias test expected embedded but got sidecar.
Root cause: AUTOSKILL_OPENCLAW_RUNTIME_MODE="" still participated in nullish-coalescing chain.
Resolution: normalize env runtime mode with trim and ignore empty string.
Self-Review Notes
Change is localized to config normalization logic; runtime behavior unchanged for explicit runtimeMode.
Existing sidecar defaults remain intact.
Added tests cover both positive and precedence path.
Remaining Issues / Risks
Adapter-related files embedded_runtime.js and embedded_runtime.test.mjs are still untracked in git state; needs explicit add/commit in integration step.
Repository still contains many unrelated modified files; final merge should scope to plugin-specific paths only.
Next Step
Round 3 (integration finish line):
Final consistency pass on plugin docs vs config schema.
Optional: add one README note for AUTOSKILL_OPENCLAW_NO_SIDECAR=1 alias.
Prepare scoped commit set for OpenClaw plugin paths only.
2026-03-13 - Round 3
Scope
Target area: plugin docs/config consistency.
Objective: make no-sidecar alias behavior discoverable and consistent with implemented precedence.
Completed
Updated docs:
AutoSkill4OpenClaw/README.md
AutoSkill4OpenClaw/README.zh-CN.md
Added explicit mention:
AUTOSKILL_OPENCLAW_NO_SIDECAR=1 as convenience alias.
Structural option: if product later requires embedded + store_only + retrieval, add local retrieval implementation in adapter (instead of sidecar HTTP hook dependency).
Operational: final commit should include only plugin-scoped files due dirty worktree.
Objective: prevent accidental skill pruning when runtime does not provide explicit used-skill signals.
Issue Found
Even with conservative defaults, if users manually enable prune in environments that do not reliably emit used_skill_ids, stale-skill pruning can become over-aggressive.
Initial idle-timeout archive test used touch timestamp 0, which is treated as invalid/no-touch by implementation.
Corrected tests to use a minimal positive stale timestamp (1) and strengthened runtime timeout path assertion.
Residual Risks / Next Candidates
Sidecar verification script requires a running local sidecar service and real endpoint reachability; not executed in this round.
If operators use very short idle-timeout values, sessions may be closed too aggressively in bursty workloads; recommended to keep timeout disabled (0) unless explicitly needed.
User required a no-sidecar embedded path that does not depend on manual model config by default, but still has deterministic fallback behavior when runtime APIs are not available.
Fixes Applied
AutoSkill4OpenClaw/adapter/embedded_runtime.js
replaced single-path runtime invoke with multi-mode invocation chain.
added openclaw-runtime dual behavior:
try runtime direct model invoker functions first
if failed, resolve base_url/api_key/model from runtime object and call OpenAI-compatible chat endpoint.
New embedded fallback tests initially failed due test helper shallow-merge behavior that dropped embedded.sessionArchiveDir.
Corrected makeConfig in embedded_runtime.test.mjs to deep-merge embedded overrides.
Residual Risks / Next Candidates
openclaw-config-resolve is best-effort for heterogeneous OpenClaw configs; secret-ref/OAuth-only keys may remain unresolved and correctly fall through to next mode.
Runtime object introspection is intentionally conservative to avoid hard-coupling to internal unstable APIs; if specific OpenClaw versions expose additional official runtime APIs, probe list can be extended with low risk.
2026-03-13 - Round 11 (subagent maintenance and merge hardening)
Scope
Target area: embedded openclaw-runtime-subagent path after candidate extraction.
Objective: harden maintenance decision and merge behavior (not extraction-only), preventing unsafe merge and duplicate skill bloat.
Issues Found
Maintenance merge in embedded path could be overly permissive:
LLM merge decision with weak/invalid target could still drift toward wrong merge.
Candidate parsing robustness gap:
subagent outputs may return skill object or direct object, not always skills[].
No deterministic duplicate guard before maintenance:
exact duplicate candidate could still enter decision pipeline and produce redundant skill files.
Fixes Applied
AutoSkill4OpenClaw/adapter/embedded_runtime.js
added skill payload normalization:
clamps (name/description/prompt) and dedupes triggers/tags.
extraction now accepts skills[], skill, or direct object shape.
strengthened maintenance decision policy:
action normalization supports common synonyms.
merge requires valid explicit target id or high-confidence BM25 fallback (score >= 0.72).
unsafe merge now degrades to add.
removed blind hits[0] merge fallback in maintainSkill; merge now requires resolved valid target.
added deterministic duplicate guard before decision:
if candidate matches existing skill (prompt equality / strong normalized overlap), skip with duplicate_existing_skill.
retained fail-open behavior and recursion guard.
docs updated (EN/ZH) to include embedded maintenance safety guards.
Current duplicate guard is conservative lexical matching; semantic near-duplicates still rely on BM25+LLM maintenance decision.
If production data shows false merge/add boundaries, threshold (0.72) can be moved to config in a later low-risk round.
2026-03-13 - Round 12 (README mainline switch to no-sidecar embedded)
Scope
Target area: AutoSkill4OpenClaw/README.md and AutoSkill4OpenClaw/README.zh-CN.md.
Objective: make no-sidecar embedded runtime the primary user-facing mainline, with sidecar repositioned as optional.
Changes
Rewrote top-level positioning in EN/ZH docs:
mainline is now runtimeMode=embedded (no sidecar required).
sidecar moved to optional runtime/control-plane role.
Reworked Quick Start in EN/ZH:
now starts from editing ~/.openclaw/openclaw.json plugin config for embedded mode.
removed sidecar startup as mandatory step.
added local verification steps for SkillBank + OpenClaw mirrored skills.
Reframed path sections:
default path diagrams/wording now describe embedded agent_end processing.
sidecar interaction moved under explicitly optional section.
Updated env var grouping:
recommended path now lists embedded-oriented keys.
sidecar-only operations/endpoints are explicitly labeled.
Clarified local storage paths for embedded vs sidecar archives.
Validation
Documentation consistency check by manual scan of EN/ZH files.
No code-path changes in this round; runtime behavior unchanged.
Residual Notes
Runtime default in code remains backward-compatible (sidecar) unless explicitly configured to embedded; docs now instruct explicit embedded config for new deployments.
Target area: shared prompt-pack operability and regression coverage.
Objective: ensure prompt-pack path override works from standard plugin config (not env-only), and verify sidecar prompt-profile actually consumes the shared pack.
Issues Found
Embedded prompt-pack override was effectively env-driven:
embedded_runtime.js accepted cfg.embedded.promptPackPath, but normalizeConfig did not preserve this field.
Sidecar tests validated prompt text content but did not explicitly prove that AUTOSKILL_OPENCLAW_PROMPT_PACK_PATH can override prompt source end-to-end in prompt-profile builders.
Fixes Applied
AutoSkill4OpenClaw/adapter/index.js
Added embedded.promptPackPath to normalized config output.
cd AutoSkill4OpenClaw/adapter && npm test (pass, 48 tests)
Residual Suggestions
Parser/runtime consistency still uses two lightweight implementations (Python + JS) over one shared pack format.
Current risk is low and covered by tests, but future work can factor a tiny formal schema test corpus (golden render cases) consumed by both test suites to further reduce parser drift risk.
2026-03-13 - Round 16 (embedded live session snapshot persistence)
Scope
Target area: embedded session archival behavior.
Objective: persist session data locally in real time per incoming turn (without waiting for session end), while keeping extraction trigger at session close.
Changes Applied
AutoSkill4OpenClaw/adapter/embedded_runtime.js
Added live snapshot writer:
active snapshot path: <session>.latest.json under embedded.sessionArchiveDir/<user>/
updated on every handle(payload, ...) call after appending JSONL event row
Added in-memory rolling state (liveSessionByKey) to avoid expensive full-file rescans for each live snapshot update.
Added snapshot finalization on session close/session switch:
renames .latest.json to timestamped closed file, aligned with JSONL close semantics.
Extended non-closed return payload with session_snapshot_path for observability.
Existing extraction behavior remains unchanged:
extraction still runs only on closed sessions with successful turn_type=main evidence.
Target area: lifecycle hook wiring in adapter register path.
Objective: fix the real trigger blocker where plugin is loaded but typed lifecycle hooks are never fired.
Issue Found
Adapter previously preferred api.registerHook(...) when both registerHook and on existed.
In OpenClaw 2026.3.x, typed lifecycle hooks (before_prompt_build, agent_end) are registered through api.on(...), while registerHook is for internal hooks.
Result: plugin can appear loaded (prompt pack log present), but per-turn lifecycle callbacks are not triggered.
Fixes Applied
AutoSkill4OpenClaw/adapter/index.js
changed hook registration priority:
prefer api.on(...) first
fallback to api.registerHook(...) only if on is unavailable
removed non-official camelCase hook alias registration; keep official typed names only:
before_prompt_build
agent_end
AutoSkill4OpenClaw/adapter/index.test.mjs
restored registration assertion to official snake_case hook names.
added regression test:
when both on and registerHook exist, adapter must register typed lifecycle hooks via on.
Validation
cd AutoSkill4OpenClaw/adapter && npm test (pass, 53 tests)