claude-smart 0.2.45 → 0.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/README.md +34 -5
- package/bin/claude-smart.js +295 -5
- package/package.json +22 -3
- package/plugin/.claude-plugin/plugin.json +4 -2
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/README.md +22 -2
- package/plugin/commands/clear-all.md +1 -0
- package/plugin/commands/dashboard.md +1 -0
- package/plugin/commands/learn.md +1 -0
- package/plugin/commands/restart.md +1 -0
- package/plugin/commands/show.md +1 -0
- package/plugin/dashboard/app/configure/env/page.tsx +40 -14
- package/plugin/dashboard/app/configure/server/page.tsx +51 -1
- package/plugin/dashboard/app/preferences/[id]/page.tsx +8 -8
- package/plugin/dashboard/app/skills/project/[id]/page.tsx +7 -3
- package/plugin/dashboard/app/skills/shared/[id]/page.tsx +10 -3
- package/plugin/dashboard/lib/claude-settings-file.ts +20 -10
- package/plugin/dashboard/lib/reflexio-client.ts +16 -0
- package/plugin/dashboard/lib/status.ts +10 -3
- package/plugin/dashboard/lib/types.ts +18 -6
- package/plugin/hooks/codex-hooks.json +0 -1
- package/plugin/opencode/assistant-buffer.ts +108 -0
- package/plugin/opencode/dist/assistant-buffer.js +96 -0
- package/plugin/opencode/dist/internal.js +12 -0
- package/plugin/opencode/dist/payload.js +85 -0
- package/plugin/opencode/dist/server.mjs +158 -0
- package/plugin/opencode/internal.ts +18 -0
- package/plugin/opencode/package.json +3 -0
- package/plugin/opencode/payload.ts +90 -0
- package/plugin/opencode/server.mts +174 -0
- package/plugin/opencode/tsconfig.json +13 -0
- package/plugin/pyproject.toml +20 -3
- package/plugin/scripts/_lib.sh +5 -1
- package/plugin/scripts/backend-service.sh +22 -2
- package/plugin/scripts/ensure-plugin-root.sh +4 -4
- package/plugin/scripts/hook_entry.sh +1 -1
- package/plugin/scripts/opencode-claude-compat +4 -0
- package/plugin/scripts/opencode-claude-compat.cmd +3 -0
- package/plugin/scripts/opencode-claude-compat.js +225 -0
- package/plugin/scripts/smart-install.sh +10 -8
- package/plugin/src/README.md +1 -1
- package/plugin/src/claude_smart/cli.py +304 -6
- package/plugin/src/claude_smart/env_config.py +12 -4
- package/plugin/src/claude_smart/events/session_start.py +26 -7
- package/plugin/src/claude_smart/events/stop.py +1 -1
- package/plugin/src/claude_smart/ids.py +1 -1
- package/plugin/src/claude_smart/reflexio_adapter.py +5 -5
- package/plugin/src/claude_smart/runtime.py +7 -1
- package/plugin/uv.lock +1 -1
- package/plugin/vendor/reflexio/.env.example +54 -30
- package/plugin/vendor/reflexio/README.md +14 -8
- package/plugin/vendor/reflexio/pyproject.toml +13 -1
- package/plugin/vendor/reflexio/reflexio/README.md +1 -0
- package/plugin/vendor/reflexio/reflexio/cli/README.md +9 -7
- package/plugin/vendor/reflexio/reflexio/cli/__main__.py +10 -1
- package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +22 -5
- package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +34 -4
- package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +12 -7
- package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +13 -6
- package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +210 -50
- package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +15 -2
- package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +292 -22
- package/plugin/vendor/reflexio/reflexio/cli/log_format.py +29 -4
- package/plugin/vendor/reflexio/reflexio/cli/run_services.py +17 -8
- package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +13 -10
- package/plugin/vendor/reflexio/reflexio/client/client.py +57 -13
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +135 -257
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/npm/openclaw-smart/bin/openclaw-smart.js +13 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/npm/openclaw-smart/package.json +15 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/README.md +38 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +151 -110
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +20 -10
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +28 -6
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/pyproject.toml +42 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/_lib.sh +371 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/backend-log-runner.sh +33 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/backend-service.sh +271 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/cli.sh +68 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/dashboard-open.sh +15 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/ensure-plugin-root.sh +84 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/hook_entry.sh +106 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/npm-cli.js +219 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/scripts/smart-install.sh +269 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/clear-all/SKILL.md +8 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/dashboard/SKILL.md +8 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/learn/SKILL.md +10 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +15 -44
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/restart/SKILL.md +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/show/SKILL.md +8 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/cli.py +634 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/context_format.py +224 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/context_inject.py +79 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/after_tool_call.py +160 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/agent_end.py +187 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/before_prompt_build.py +69 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/before_tool_call.py +30 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/session_end.py +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/events/session_start.py +130 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/hook.py +131 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/ids.py +94 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/internal_call.py +75 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/oc_cite.py +196 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/optimizer_assistant.py +272 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/publish.py +96 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/query_compose.py +66 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/reflexio_adapter.py +336 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/runtime.py +47 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/stall_banner.py +61 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/src/openclaw_smart/state.py +323 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_e2e_session_loop.py +190 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_publish_to_local_reflexio_integration.py +112 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_recursion_guard_integration.py +86 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/integration/test_search_inject_integration.py +144 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_cli.py +184 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_after_tool_call.py +142 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_agent_end.py +233 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_before_prompt_build.py +116 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_before_tool_call.py +35 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_session_end.py +47 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_events_session_start.py +109 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_hook_dispatch.py +117 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_ids.py +41 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_internal_call.py +50 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_oc_cite.py +88 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_publish.py +48 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_query_compose.py +48 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_reflexio_adapter.py +188 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_runtime.py +41 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests/test_state.py +235 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/__mocks__/plugin-entry-stub.ts +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/test_npm_cli.test.ts +56 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tests-ts/test_shim_dispatch.test.ts +171 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/tsconfig.build.json +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/{tsconfig.json → plugin/tsconfig.json} +2 -2
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/uv.lock +3835 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/vitest.config.ts +18 -0
- package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +238 -10
- package/plugin/vendor/reflexio/reflexio/lib/_config.py +11 -4
- package/plugin/vendor/reflexio/reflexio/lib/_generation.py +16 -5
- package/plugin/vendor/reflexio/reflexio/lib/_lineage_parity_readers.py +187 -0
- package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +198 -6
- package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +1 -1
- package/plugin/vendor/reflexio/reflexio/lib/_search.py +29 -20
- package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +2 -1
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +127 -38
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +4 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +64 -41
- package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +19 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +12 -5
- package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +52 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +5 -1
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +5 -1
- package/plugin/vendor/reflexio/reflexio/models/config_schema.py +88 -7
- package/plugin/vendor/reflexio/reflexio/models/structured_output.py +148 -0
- package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +3 -3
- package/plugin/vendor/reflexio/reflexio/server/README.md +45 -32
- package/plugin/vendor/reflexio/reflexio/server/__init__.py +29 -5
- package/plugin/vendor/reflexio/reflexio/server/__main__.py +2 -2
- package/plugin/vendor/reflexio/reflexio/server/_auth.py +65 -2
- package/plugin/vendor/reflexio/reflexio/server/api.py +734 -85
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/precondition_checks.py +7 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/request_context.py +3 -1
- package/plugin/vendor/reflexio/reflexio/server/billing_meter.py +173 -0
- package/plugin/vendor/reflexio/reflexio/server/billing_signals.py +64 -0
- package/plugin/vendor/reflexio/reflexio/server/cache/reflexio_cache.py +46 -16
- package/plugin/vendor/reflexio/reflexio/server/env_utils.py +65 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/embedding_service.py +19 -4
- package/plugin/vendor/reflexio/reflexio/server/llm/litellm_client.py +264 -77
- package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +69 -7
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/embedding_service_provider.py +75 -16
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/openclaw_provider.py +280 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/token_accounting.py +48 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/tools.py +107 -17
- package/plugin/vendor/reflexio/reflexio/server/operation_limiter.py +360 -4
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.6.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.7.0.prompt.md +85 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.2.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.3.0.prompt.md +253 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.2.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.3.prompt.md +74 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.3.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.3.0.prompt.md +266 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.4.0.prompt.md +266 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.4.0.prompt.md +137 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +1 -1
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.3.0.prompt.md +34 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +5 -12
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +5 -12
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.2.0.prompt.md +155 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/tagging/v1.0.0.prompt.md +23 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +89 -32
- package/plugin/vendor/reflexio/reflexio/server/services/README.md +26 -11
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/README.md +22 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +4 -2
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/components/__init__.py +7 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{agent_success_evaluator.py → components/evaluator.py} +3 -16
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +28 -72
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{group_evaluation_runner.py → runner.py} +12 -10
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{delayed_group_evaluator.py → scheduler.py} +10 -2
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/{agent_success_evaluation_service.py → service.py} +36 -1
- package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +160 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +5 -0
- package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +1 -1
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/README.md +9 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/components/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{rule_attribution.py → components/rule_attribution.py} +10 -9
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +15 -24
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +238 -164
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/README.md +31 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +13 -3
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +3 -2
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +32 -118
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +39 -16
- package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +105 -23
- package/plugin/vendor/reflexio/reflexio/server/services/lineage/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/lineage/gc_scheduler.py +193 -0
- package/plugin/vendor/reflexio/reflexio/server/services/lineage/resolve.py +98 -0
- package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +26 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +11 -12
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/components/__init__.py +5 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_aggregator.py → components/aggregator.py} +316 -178
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_consolidator.py → components/consolidator.py} +168 -62
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_extractor.py → components/extractor.py} +5 -1
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_edit_apply.py +74 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +33 -3
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/{playbook_generation_service.py → service.py} +121 -19
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/user_detail_stripping.py +84 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/README.md +10 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +2 -1
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +178 -30
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/README.md +9 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/components/__init__.py +17 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_deduplicator.py → components/consolidator.py} +7 -6
- package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_extractor.py → components/extractor.py} +30 -22
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +6 -13
- package/plugin/vendor/reflexio/reflexio/server/services/profile/{profile_generation_service.py → service.py} +32 -50
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +4 -8
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/components/__init__.py +7 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +12 -1
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/{reflection_service.py → service.py} +36 -16
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +83 -6
- package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +36 -1
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/README.md +8 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +1 -2
- package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +27 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +9 -9
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +2 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +4 -1
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +642 -197
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +61 -104
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_lineage.py +628 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +38 -6
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +978 -184
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +519 -128
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +77 -3
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +23 -9
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +5 -2
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +131 -20
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +2 -8
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +5 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +36 -53
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_lineage.py +215 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +20 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +243 -7
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +121 -1
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +60 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_retrieval_log.py +51 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +17 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/README.md +8 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/service.py +200 -0
- package/plugin/vendor/reflexio/reflexio/server/services/tagging/tagging_scheduler.py +149 -0
- package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +229 -32
- package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +2 -1
- package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +120 -1
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +4 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/search_settings.json +5 -0
- package/plugin/vendor/reflexio/reflexio/server/tracing.py +30 -0
- package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +18 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +61 -26
- package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +41 -4
- package/scripts/setup-claude-smart.sh +8 -3
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +0 -517
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +0 -473
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +0 -2156
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +0 -18
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +0 -241
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +0 -140
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +0 -113
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +0 -52
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +0 -103
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +0 -156
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +0 -134
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +0 -24
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +0 -278
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +0 -164
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +0 -36
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +0 -35
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +0 -27
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +0 -31
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +0 -42
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +0 -49
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +0 -91
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +0 -50
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +0 -13
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +0 -192
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +0 -303
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +0 -138
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +0 -1125
- /package/plugin/vendor/reflexio/reflexio/integrations/{__init__.py → openclaw/plugin/src/openclaw_smart/__init__.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/integrations/openclaw/{types → plugin/types}/openclaw.d.ts +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{distribution.py → components/distribution.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{hero_state.py → components/hero_state.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/{shadow_aggregation.py → components/shadow_aggregation.py} +0 -0
- /package/plugin/vendor/reflexio/reflexio/server/services/reflection/{reflection_extractor.py → components/extractor.py} +0 -0
|
@@ -1,517 +0,0 @@
|
|
|
1
|
-
# Manual Testing Guide — Reflexio × OpenClaw Federated Plugin
|
|
2
|
-
|
|
3
|
-
Step-by-step guide for manually testing the plugin end-to-end. Each phase builds on the previous one. This guide is self-contained — you should not need to reference other documentation.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
- OpenClaw installed and running: `openclaw --version`
|
|
8
|
-
- Reflexio OpenClaw plugin installed: `./scripts/install.sh` or `clawhub plugin install reflexio-federated`
|
|
9
|
-
- An LLM API key for the Reflexio server (e.g., `export OPENAI_API_KEY=sk-...`)
|
|
10
|
-
- A terminal where you can see OpenClaw's stderr output (agent logs)
|
|
11
|
-
|
|
12
|
-
### How to view agent logs
|
|
13
|
-
|
|
14
|
-
OpenClaw outputs hook logs to stderr. To see Reflexio hook messages during a session:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Option A: Run openclaw in a terminal and watch stderr
|
|
18
|
-
openclaw chat 2>reflexio-hook.log
|
|
19
|
-
# In another terminal: tail -f reflexio-hook.log
|
|
20
|
-
|
|
21
|
-
# Option B: Run with stderr visible
|
|
22
|
-
openclaw chat 2>&1 | tee session.log
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Look for lines starting with `[reflexio]` — these are from the Reflexio hooks.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Phase 1: Install & Verify
|
|
30
|
-
|
|
31
|
-
### 1.1 Install the plugin (if not already installed)
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Option A: From source
|
|
35
|
-
cd /path/to/reflexio/integrations/openclaw
|
|
36
|
-
./scripts/install.sh
|
|
37
|
-
|
|
38
|
-
# Option B: Via ClawHub
|
|
39
|
-
clawhub plugin install reflexio-federated
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 1.2 Verify plugin is loaded
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
openclaw plugins list
|
|
46
|
-
# Expected: reflexio-federated (loaded)
|
|
47
|
-
|
|
48
|
-
openclaw plugins inspect reflexio-federated
|
|
49
|
-
# Expected: Status: loaded
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
If the plugin shows as "disabled" or failed, run:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
openclaw plugins enable reflexio-federated
|
|
56
|
-
openclaw gateway restart
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 1.3 Verify Reflexio server (optional)
|
|
60
|
-
|
|
61
|
-
The plugin automatically starts the local Reflexio server on first agent session (see Phase 2). You can optionally verify it manually:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
reflexio status check
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
If the server isn't running yet, that's fine — the plugin will start it automatically during first-use setup.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Phase 2: First-Session Auto-Setup & Server Auto-Start
|
|
72
|
-
|
|
73
|
-
This phase verifies the plugin's first-use setup (CLI detection, LLM provider prompt, server startup) and that the search hook works correctly with no playbooks yet.
|
|
74
|
-
|
|
75
|
-
### 2.0 Ensure the server is NOT running (optional)
|
|
76
|
-
|
|
77
|
-
If you want to test auto-start, stop the server if it's running:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
reflexio services stop 2>/dev/null
|
|
81
|
-
# Verify it's stopped:
|
|
82
|
-
reflexio status check
|
|
83
|
-
# Expected: connection error or "Server is not running"
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
If the server is already running, that's fine — Phase 2.1 will still verify the plugin works with an existing server.
|
|
87
|
-
|
|
88
|
-
### 2.1 Start a conversation — the plugin should perform first-use setup
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
openclaw chat
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Send a simple, self-contained task that doesn't require a project:
|
|
95
|
-
|
|
96
|
-
```text
|
|
97
|
-
Write a Python function that takes a list of numbers and returns the mean and median.
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**What to check:**
|
|
101
|
-
- The agent responds normally with working code (no errors, no mention of Reflexio)
|
|
102
|
-
- On first session, you may see a one-time LLM provider setup prompt (if reflexio-ai CLI needs initialization)
|
|
103
|
-
- In the plugin logs (stderr), you should see:
|
|
104
|
-
- `[reflexio] agent:bootstrap hook fired` — the bootstrap handler ran
|
|
105
|
-
- `[reflexio] Server running` or `[reflexio] Starting server` — server health check
|
|
106
|
-
- Potentially `[reflexio] Per-message search` — search attempted for first message
|
|
107
|
-
- The response should NOT be delayed more than ~5 seconds by the plugin (timeout limit)
|
|
108
|
-
- If setup runs, look for confirmation messages about LLM provider and storage configuration
|
|
109
|
-
|
|
110
|
-
### 2.2 Verify the server is running
|
|
111
|
-
|
|
112
|
-
After the first message, check:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
reflexio status check
|
|
116
|
-
# Expected: Server is running
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
The plugin starts the server in the background during `agent:bootstrap` if needed. Subsequent messages in this session (and all future sessions) will find the server ready.
|
|
120
|
-
|
|
121
|
-
### 2.3 Send a second message to verify search is working
|
|
122
|
-
|
|
123
|
-
In the same session:
|
|
124
|
-
|
|
125
|
-
```text
|
|
126
|
-
Now write a version that also returns the standard deviation.
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**What to check:**
|
|
130
|
-
- In plugin logs: search should be attempted (look for `[reflexio]` lines with search-related messages)
|
|
131
|
-
- Search results may be empty (no playbooks yet on cold start) — that's expected
|
|
132
|
-
- No search timeout errors in logs (timeout is 5 seconds by default)
|
|
133
|
-
|
|
134
|
-
### 2.4 Verify the agent doesn't mention Reflexio
|
|
135
|
-
|
|
136
|
-
The agent's behavioral rule says "never mention Reflexio to the user." Confirm the agent response contains no references to Reflexio, playbooks, or search results.
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Phase 3: Capture & Publish
|
|
141
|
-
|
|
142
|
-
This phase creates a correction scenario and verifies the system captures it.
|
|
143
|
-
|
|
144
|
-
### 3.1 Create a correction scenario
|
|
145
|
-
|
|
146
|
-
In the same session (or a new one via `openclaw chat`), send these messages in order. The goal is to get the agent to do something one way, then correct it:
|
|
147
|
-
|
|
148
|
-
**Message 1** — give a task with an implicit choice:
|
|
149
|
-
```text
|
|
150
|
-
Write a shell script that installs project dependencies and starts the dev server.
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Wait for the agent to respond. It will likely use `npm install` or a similar default.
|
|
154
|
-
|
|
155
|
-
**Message 2** — correct the agent's choice:
|
|
156
|
-
```text
|
|
157
|
-
No, don't use npm. In this project we always use pnpm. Please rewrite using pnpm instead.
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Wait for the agent to apply the correction.
|
|
161
|
-
|
|
162
|
-
**Message 3** — continue the task to provide more context:
|
|
163
|
-
```text
|
|
164
|
-
Also add a health check that curls localhost:3000/health before starting the main process.
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**What to check:**
|
|
168
|
-
- The agent applies the correction (uses pnpm in the rewrite)
|
|
169
|
-
- In plugin logs: look for publish-related messages — the plugin should detect the correction
|
|
170
|
-
- If you don't see a publish during the session, that's OK — the session-end hook will capture the full conversation and publish it then
|
|
171
|
-
|
|
172
|
-
### 3.2 End the session
|
|
173
|
-
|
|
174
|
-
Exit the session:
|
|
175
|
-
```text
|
|
176
|
-
/stop
|
|
177
|
-
```
|
|
178
|
-
(or press Ctrl+C, depending on your OpenClaw configuration)
|
|
179
|
-
|
|
180
|
-
**What to check in plugin logs:**
|
|
181
|
-
- `[reflexio] command:stop hook fired` — the plugin detected session end
|
|
182
|
-
- `[reflexio] Queued N interactions for publish` — buffered turns are being published
|
|
183
|
-
- `[reflexio] Published via reflexio_publish CLI` — the publish command executed successfully
|
|
184
|
-
|
|
185
|
-
### 3.3 Verify playbooks were extracted
|
|
186
|
-
|
|
187
|
-
Wait ~30 seconds for server-side LLM extraction, then check:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
reflexio user-playbooks list --limit 10
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**Expected:** At least one playbook containing "pnpm" (e.g., content like "use pnpm instead of npm").
|
|
194
|
-
|
|
195
|
-
If no playbooks appear, the batch interval may not have been met (requires 5+ interactions). Use the manual extraction command instead:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# If no playbooks were extracted automatically, this is expected for short sessions.
|
|
199
|
-
# Phase 5 covers manual extraction as a workaround.
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
Also check profiles:
|
|
203
|
-
```bash
|
|
204
|
-
reflexio user-profiles list --limit 10
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
You may see a profile entry about project conventions (e.g., "uses pnpm").
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
## Phase 4: Retrieval (Warm Start)
|
|
212
|
-
|
|
213
|
-
This phase verifies the agent applies corrections from previous sessions.
|
|
214
|
-
|
|
215
|
-
### 4.1 Start a new session and trigger a related task
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
openclaw chat
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Send a task related to the correction from Phase 3:
|
|
222
|
-
|
|
223
|
-
```text
|
|
224
|
-
Add the 'lodash' package to this project's dependencies.
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
**What to check:**
|
|
228
|
-
- In plugin logs: `[reflexio]` lines showing search was executed before the response
|
|
229
|
-
- The agent should use `pnpm add lodash` (not `npm install lodash`) — applying the correction from Phase 3 **without being told again**
|
|
230
|
-
- If the agent still uses npm, the playbook may not have been extracted yet. Check `reflexio user-playbooks list` and retry after extraction completes.
|
|
231
|
-
|
|
232
|
-
### 4.2 Send an unrelated task
|
|
233
|
-
|
|
234
|
-
In the same session:
|
|
235
|
-
|
|
236
|
-
```text
|
|
237
|
-
Explain how Python's garbage collector works.
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**What to check:**
|
|
241
|
-
- The search returns different (or no) playbooks — the pnpm correction should NOT appear for a Python question
|
|
242
|
-
- The agent responds normally
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## Phase 5: Manual Commands
|
|
247
|
-
|
|
248
|
-
### 5.1 Test `/reflexio-extract`
|
|
249
|
-
|
|
250
|
-
Start a new session and have a conversation with at least one correction or learning:
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
openclaw chat
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
Send a few messages:
|
|
257
|
-
```text
|
|
258
|
-
Write a function to validate email addresses using regex.
|
|
259
|
-
```
|
|
260
|
-
Then after the response:
|
|
261
|
-
```text
|
|
262
|
-
That regex is too permissive. Use a stricter pattern that requires a TLD of at least 2 characters.
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
Now use the `reflexio_publish` tool to flush immediately:
|
|
266
|
-
|
|
267
|
-
Ask the agent to use the `reflexio_publish` tool to publish the conversation:
|
|
268
|
-
|
|
269
|
-
```text
|
|
270
|
-
Please publish our conversation using the reflexio_publish tool so I can test the publish mechanism.
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
**What to check:**
|
|
274
|
-
- The agent calls the `reflexio_publish` tool
|
|
275
|
-
- Tool output confirms the conversation was published (e.g., "Published 2 interactions to Reflexio")
|
|
276
|
-
- Verify extraction worked:
|
|
277
|
-
```bash
|
|
278
|
-
reflexio user-playbooks list --limit 10
|
|
279
|
-
```
|
|
280
|
-
You should see a new playbook about email validation regex.
|
|
281
|
-
|
|
282
|
-
### 5.2 Test manual aggregation
|
|
283
|
-
|
|
284
|
-
After accumulating playbooks from Phases 3-5.1, manually trigger aggregation:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
reflexio agent-playbooks aggregate --agent-version openclaw-agent --wait
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
**What to check:**
|
|
291
|
-
- Command completes without errors
|
|
292
|
-
- Reports how many agent playbooks were created or updated
|
|
293
|
-
- Verify:
|
|
294
|
-
```bash
|
|
295
|
-
reflexio agent-playbooks list --agent-version openclaw-agent
|
|
296
|
-
```
|
|
297
|
-
You should see agent playbooks with `PENDING` status.
|
|
298
|
-
|
|
299
|
-
---
|
|
300
|
-
|
|
301
|
-
## Phase 6: Multi-User (Multiple Agent Instances)
|
|
302
|
-
|
|
303
|
-
This phase tests that different OpenClaw agents get isolated user playbooks but share agent playbooks.
|
|
304
|
-
|
|
305
|
-
### 6.1 Set up a second agent instance
|
|
306
|
-
|
|
307
|
-
If you don't already have multiple agents, create one. OpenClaw stores agent definitions in `~/.openclaw/openclaw.json`. Add a second agent:
|
|
308
|
-
|
|
309
|
-
```bash
|
|
310
|
-
openclaw agents add --name test-reviewer
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
This creates a new agent with its own workspace at `~/.openclaw/workspace-test-reviewer/`.
|
|
314
|
-
|
|
315
|
-
Verify both agents exist:
|
|
316
|
-
```bash
|
|
317
|
-
openclaw agents list
|
|
318
|
-
# Should show at least two agents (e.g., "main" and "test-reviewer")
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
> **Note:** Use whatever agent names you already have. The test just needs two distinct agents. Replace `main` and `test-reviewer` in the commands below with your actual agent names.
|
|
322
|
-
|
|
323
|
-
### 6.2 Create different corrections on each agent
|
|
324
|
-
|
|
325
|
-
**Agent 1** (your default agent):
|
|
326
|
-
```bash
|
|
327
|
-
openclaw chat
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
Have this conversation:
|
|
331
|
-
```text
|
|
332
|
-
Write a function to format a date as a string.
|
|
333
|
-
```
|
|
334
|
-
Then:
|
|
335
|
-
```text
|
|
336
|
-
Always use ISO 8601 format (YYYY-MM-DD) for dates, never locale-specific formats.
|
|
337
|
-
```
|
|
338
|
-
Exit: `/stop`
|
|
339
|
-
|
|
340
|
-
**Agent 2** (your second agent):
|
|
341
|
-
```bash
|
|
342
|
-
openclaw chat --agent test-reviewer
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
Have this conversation:
|
|
346
|
-
```text
|
|
347
|
-
Write a function to log errors.
|
|
348
|
-
```
|
|
349
|
-
Then:
|
|
350
|
-
```text
|
|
351
|
-
Always include the stack trace when logging errors, not just the message.
|
|
352
|
-
```
|
|
353
|
-
Exit: `/stop`
|
|
354
|
-
|
|
355
|
-
### 6.3 Verify user playbook isolation
|
|
356
|
-
|
|
357
|
-
Wait ~30 seconds for extraction, then check. Replace `main` and `test-reviewer` with your actual agent names:
|
|
358
|
-
|
|
359
|
-
```bash
|
|
360
|
-
# Check what each agent sees (use your actual agent names)
|
|
361
|
-
reflexio user-playbooks list --user-id main
|
|
362
|
-
reflexio user-playbooks list --user-id test-reviewer
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
**Expected:**
|
|
366
|
-
- Agent 1's playbooks include the date formatting correction, NOT the error logging one
|
|
367
|
-
- Agent 2's playbooks include the error logging correction, NOT the date formatting one
|
|
368
|
-
|
|
369
|
-
> **Note:** If playbooks weren't extracted (batch interval not met), manually extract from each agent's session using `/reflexio-extract`, or seed playbooks directly:
|
|
370
|
-
> ```bash
|
|
371
|
-
> reflexio user-playbooks add --user-id main --content "Always use ISO 8601 (YYYY-MM-DD) for date formatting" --trigger "formatting dates"
|
|
372
|
-
> reflexio user-playbooks add --user-id test-reviewer --content "Always include stack traces when logging errors" --trigger "logging errors"
|
|
373
|
-
> ```
|
|
374
|
-
|
|
375
|
-
### 6.4 Aggregate and verify shared playbooks
|
|
376
|
-
|
|
377
|
-
```bash
|
|
378
|
-
reflexio agent-playbooks aggregate --agent-version openclaw-agent --wait
|
|
379
|
-
reflexio agent-playbooks list --agent-version openclaw-agent
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
**Expected:**
|
|
383
|
-
- Agent playbooks contain corrections from **both** agents (date formatting + error logging)
|
|
384
|
-
- Search from either agent returns the shared playbooks:
|
|
385
|
-
```bash
|
|
386
|
-
reflexio search "format a date" --user-id main
|
|
387
|
-
reflexio search "format a date" --user-id test-reviewer
|
|
388
|
-
```
|
|
389
|
-
Both should return the date formatting agent playbook.
|
|
390
|
-
|
|
391
|
-
### 6.5 Clean up test agent (optional)
|
|
392
|
-
|
|
393
|
-
If you created a test agent just for this phase:
|
|
394
|
-
```bash
|
|
395
|
-
openclaw agents remove --name test-reviewer
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
---
|
|
399
|
-
|
|
400
|
-
## Phase 7: Graceful Degradation
|
|
401
|
-
|
|
402
|
-
### 7.1 Stop the server and verify agent still works
|
|
403
|
-
|
|
404
|
-
```bash
|
|
405
|
-
reflexio services stop
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
Start a new OpenClaw session:
|
|
409
|
-
```bash
|
|
410
|
-
openclaw chat
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
Send a task:
|
|
414
|
-
```text
|
|
415
|
-
Explain the difference between TCP and UDP.
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
**What to check:**
|
|
419
|
-
- The agent responds normally (no crashes, no errors visible to the user)
|
|
420
|
-
- In hook logs:
|
|
421
|
-
- `[reflexio] Server not running — starting in background` — auto-start triggered at bootstrap
|
|
422
|
-
- `[reflexio] Per-message search failed` — first search may fail while server starts (expected)
|
|
423
|
-
- The hook buffers the turn to local SQLite (`~/.reflexio/sessions.db`) — it will be published when the server is ready
|
|
424
|
-
|
|
425
|
-
### 7.2 Verify the server auto-recovered
|
|
426
|
-
|
|
427
|
-
Wait ~10 seconds after the first message, then check:
|
|
428
|
-
|
|
429
|
-
```bash
|
|
430
|
-
reflexio status check
|
|
431
|
-
# Expected: Server is running (auto-started by the hook)
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
Send a second message in the same session:
|
|
435
|
-
```text
|
|
436
|
-
Now explain when you'd use one over the other.
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
**What to check:**
|
|
440
|
-
- Search should succeed now (server is running)
|
|
441
|
-
- No "Search failed" errors in hook logs for this message
|
|
442
|
-
|
|
443
|
-
### 7.3 Verify buffered turns are retried on next session
|
|
444
|
-
|
|
445
|
-
Exit the current session: `/stop`
|
|
446
|
-
|
|
447
|
-
Start a new session (this triggers the `agent:bootstrap` event):
|
|
448
|
-
```bash
|
|
449
|
-
openclaw chat
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
**What to check in hook logs:**
|
|
453
|
-
- `[reflexio] Retrying N unpublished session(s)` — the bootstrap handler retries buffered turns from the previous session where the server wasn't ready
|
|
454
|
-
|
|
455
|
-
Exit the session: `/stop`
|
|
456
|
-
|
|
457
|
-
---
|
|
458
|
-
|
|
459
|
-
## Phase 8: Uninstall
|
|
460
|
-
|
|
461
|
-
### 8.1 Uninstall the plugin
|
|
462
|
-
|
|
463
|
-
```bash
|
|
464
|
-
cd /path/to/reflexio/integrations/openclaw
|
|
465
|
-
./scripts/uninstall.sh
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
Or if using ClawHub:
|
|
469
|
-
|
|
470
|
-
```bash
|
|
471
|
-
clawhub plugin uninstall reflexio-federated
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
### 8.2 Verify plugin is removed
|
|
475
|
-
|
|
476
|
-
```bash
|
|
477
|
-
openclaw plugins list
|
|
478
|
-
# Should NOT show reflexio-federated
|
|
479
|
-
|
|
480
|
-
openclaw plugins inspect reflexio-federated 2>&1 | grep -i "not found"
|
|
481
|
-
# Expected: plugin not found or similar error
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
### 8.3 Verify agent works without plugin
|
|
485
|
-
|
|
486
|
-
```bash
|
|
487
|
-
openclaw chat
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
Send any message and confirm the agent works normally with no Reflexio-related errors or log lines.
|
|
491
|
-
|
|
492
|
-
### 8.4 Optional: Delete user data
|
|
493
|
-
|
|
494
|
-
To remove stored conversations and playbooks:
|
|
495
|
-
|
|
496
|
-
```bash
|
|
497
|
-
cd /path/to/reflexio/integrations/openclaw
|
|
498
|
-
./scripts/uninstall.sh --purge
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
This deletes `~/.reflexio/` entirely. If you only ran `uninstall.sh` without `--purge`, data is preserved in case you want to re-enable the plugin later.
|
|
502
|
-
|
|
503
|
-
---
|
|
504
|
-
|
|
505
|
-
## Troubleshooting
|
|
506
|
-
|
|
507
|
-
| Symptom | Cause | Fix |
|
|
508
|
-
|---------|-------|-----|
|
|
509
|
-
| Plugin doesn't load | Plugin not installed or gateway not restarted | Run `./scripts/install.sh` or `clawhub plugin install reflexio-federated`; verify with `openclaw plugins list` |
|
|
510
|
-
| Agent doesn't follow past corrections | Search plugin timeout or no playbooks yet | Check `reflexio user-playbooks list`; verify server is running with `reflexio status check` |
|
|
511
|
-
| `[reflexio] Search failed` in every message | Server not running | `reflexio services start --only backend &` or restart the agent |
|
|
512
|
-
| Playbooks not extracted after session | Batch interval not met (need 5+ interactions) | Use `reflexio_publish` tool to manually flush, or seed playbooks with `reflexio user-playbooks add` |
|
|
513
|
-
| Agent mentions Reflexio to user | Agent behavioral rule not applied | Check if plugin skills loaded correctly; restart agent |
|
|
514
|
-
| First-use setup never ran | LLM provider already configured | Run `reflexio setup openclaw` manually if you need to reconfigure |
|
|
515
|
-
| Aggregation never runs | Flag file stuck | `rm ~/.reflexio/logs/.aggregation-running` |
|
|
516
|
-
| Can't start second agent | Agent not configured in OpenClaw | `openclaw agents add --name <name>` then `openclaw agents list` to verify |
|
|
517
|
-
| Search returns corrections from wrong agent | User playbooks aren't scoped by agent | Verify user_id resolution with `reflexio search "<query>" --user-id <agent-name>` |
|