feat: implement OpenClaw agent training system with CLI command execution
Some checks failed
CLI Tests / test-cli (push) Failing after 5s
Deploy to Testnet / deploy-testnet (push) Successful in 1m52s
Documentation Validation / validate-docs (push) Failing after 10s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Security Scanning / security-scan (push) Successful in 34s
Node Failover Simulation / failover-test (push) Successful in 10s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s

Added comprehensive agent training functionality that executes actual AITBC CLI commands:

- Renamed openclaw_operations to openclaw_training_operations in aitbc_cli.py
- Added train action with agent/validate/certify subcommands to openclaw_operations
- Implemented agent training that loads JSON training data and executes real CLI commands
- Added operation mapping for wallet, blockchain, messaging, and system commands
- Skip
This commit is contained in:
aitbc
2026-05-04 18:23:30 +02:00
parent 340d781f02
commit dae8ad6569
27 changed files with 4377 additions and 25 deletions

View File

@@ -191,8 +191,8 @@ def handle_agent_sdk_action(args, render_mapping):
render_mapping("SDK Operation:", sdk_result)
def handle_openclaw_action(args, openclaw_operations, first, render_mapping):
"""Handle OpenClaw action command."""
def handle_openclaw_training_action(args, openclaw_training_operations, first, render_mapping):
"""Handle OpenClaw training action command."""
kwargs = {}
for name in ("agent_file", "wallet", "environment", "agent_id", "metrics", "price"):
value = getattr(args, name, None)
@@ -201,10 +201,33 @@ def handle_openclaw_action(args, openclaw_operations, first, render_mapping):
market_action = first(getattr(args, "market_action", None), getattr(args, "market_action_opt", None))
if market_action:
kwargs["market_action"] = market_action
result = openclaw_operations(args.openclaw_action, **kwargs)
# Handle train actions
if getattr(args, "openclaw_training_action", None) == "train":
train_action = getattr(args, "train_action", None)
if train_action == "agent":
for name in ("agent_id", "stage", "training_data", "log_level"):
value = getattr(args, name, None)
if value not in (None, "", False):
kwargs[name] = value
kwargs["train_action"] = "agent"
elif train_action == "validate":
for name in ("agent_id", "stage"):
value = getattr(args, name, None)
if value not in (None, "", False):
kwargs[name] = value
kwargs["train_action"] = "validate"
elif train_action == "certify":
for name in ("agent_id",):
value = getattr(args, name, None)
if value not in (None, "", False):
kwargs[name] = value
kwargs["train_action"] = "certify"
result = openclaw_training_operations(args.openclaw_training_action, **kwargs)
if not result:
sys.exit(1)
render_mapping(f"OpenClaw {result['action']}:", result)
render_mapping(f"OpenClaw Training {result['action']}:", result)
def handle_workflow_action(args, workflow_operations, render_mapping):