Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test(smoke): prove per-agent session reuse

Bosch90a81ad613b3
diff --git a/tests/manual/openclaw-plugin-smoke/README.md b/tests/manual/openclaw-plugin-smoke/README.md
index e6b90686..1f0c5a57 100644
--- a/tests/manual/openclaw-plugin-smoke/README.md
+++ b/tests/manual/openclaw-plugin-smoke/README.md
@@ -10,6 +10,7 @@ What it does:
- runs several `openclaw agent` prompts against the fixture site
- verifies the returned answers
- verifies fixture access logs show real browser traffic from Pinchtab
+- proves same-agent session reuse and cross-agent isolation with dedicated `alpha` / `beta` smoke turns
## Requirements
@@ -37,7 +38,7 @@ OPENCLAW_VERSION=2026.5.2 \
The script copies results into `tests/manual/openclaw-plugin-smoke/artifacts/<timestamp>/`:
-- `summary.json` — scenario results + log checks
+- `summary.json` — scenario results + log checks, including `sessionProof`
- `agent-*.json` — raw OpenClaw CLI output per prompt
- `gateway.log` — OpenClaw gateway log
- `plugin-install.log` — plugin install log
diff --git a/tests/manual/openclaw-plugin-smoke/openclaw-runner.sh b/tests/manual/openclaw-plugin-smoke/openclaw-runner.sh
index 4e4a6cd3..eeb9729a 100755
--- a/tests/manual/openclaw-plugin-smoke/openclaw-runner.sh
+++ b/tests/manual/openclaw-plugin-smoke/openclaw-runner.sh
@@ -35,6 +35,7 @@ fixtures_url = 'http://fixtures:8080'
scenarios = [
{
'id': 'alpha',
+ 'agent': 'main',
'prompt': f'Use the pinchtab tool to navigate to {fixtures_url}/alpha and reply with only the verification code on the page.',
'expected': 'ALPHA-17',
'paths': ['/alpha'],
@@ -42,6 +43,7 @@ scenarios = [
},
{
'id': 'journey',
+ 'agent': 'main',
'prompt': f'Use the pinchtab tool to navigate to {fixtures_url}/journey/start, click the Begin journey button, wait for the next page, and reply with only the final verification code.',
'expected': 'ORBIT-42',
'paths': ['/journey/start', '/journey/final'],
@@ -49,6 +51,7 @@ scenarios = [
},
{
'id': 'chain',
+ 'agent': 'main',
'prompt': f'Use the pinchtab tool to navigate to {fixtures_url}/chain/one, click through until you reach the last page, and reply with only the full final verification code.',
'expected': 'BLUE-SUN-9',
'paths': ['/chain/one', '/chain/two', '/chain/final'],
@@ -56,6 +59,7 @@ scenarios = [
},
{
'id': 'browser-alias',
+ 'agent': 'main',
'prompt': f'Use the browser tool to navigate to {fixtures_url}/alpha and reply with only the verification code on the page.',
'expected': 'ALPHA-17',
'paths': ['/alpha'],
@@ -63,12 +67,38 @@ scenarios = [
},
]
-results = []
-for scenario in scenarios:
+session_scenarios = [
+ {
+ 'id': 'agent-alpha-start',
+ 'agent': 'alpha',
+ 'prompt': f'Use the pinchtab tool to navigate to {fixtures_url}/journey/start, click the Begin journey button, wait for the next page to load, and reply with only READY.',
+ 'expected': 'READY',
+ 'paths': ['/journey/start', '/journey/final'],
+ 'requiredTool': 'pinchtab',
+ },
+ {
+ 'id': 'agent-alpha-reuse',
+ 'agent': 'alpha',
+ 'prompt': f'Use the pinchtab tool to continue the existing browser session for this agent, navigate to {fixtures_url}/journey/final, and reply with only the verification code on the page.',
+ 'expected': 'ORBIT-42',
+ 'paths': ['/journey/final'],
+ 'requiredTool': 'pinchtab',
+ },
+ {
+ 'id': 'agent-beta-isolated',
+ 'agent': 'beta',
+ 'prompt': f'Use the pinchtab tool to continue the existing browser session for this agent, navigate to {fixtures_url}/journey/final, and reply with only the verification code on the page.',
+ 'expected': 'MISSING-STATE',
+ 'paths': ['/journey/final'],
+ 'requiredTool': 'pinchtab',
+ },
+]
+
+def run_agent_scenario(scenario):
out_path = artifacts / f"agent-{scenario['id']}.json"
cmd = [
'openclaw', 'agent',
- '--agent', 'main',
+ '--agent', scenario['agent'],
'--message', scenario['prompt'],
'--json',
'--timeout', '240',
@@ -81,8 +111,9 @@ for scenario in scenarios:
text = payload['result']['payloads'][0]['text'].strip()
tool_summary = payload['result']['meta'].get('toolSummary', {})
tools_used = tool_summary.get('tools', []) or []
- results.append({
+ return {
'id': scenario['id'],
+ 'agent': scenario['agent'],
'expected': scenario['expected'],
'actual': text,
'ok': text == scenario['expected'],
@@ -90,7 +121,10 @@ for scenario in scenarios:
'requiredTool': scenario['requiredTool'],
'toolsUsed': tools_used,
'toolOk': scenario['requiredTool'] in tools_used,
- })
+ }
+
+results = [run_agent_scenario(scenario) for scenario in scenarios]
+session_results = [run_agent_scenario(scenario) for scenario in session_scenarios]
log_path = artifacts / 'fixtures-access.log'
entries = []
@@ -107,7 +141,7 @@ pinchtab_api_lines = [
if 'path=/health' not in line and ' path=/' in line
]
-for result in results:
+for result in results + session_results:
missing = []
for path in result['paths']:
hits = [
@@ -119,9 +153,17 @@ for result in results:
result['fixtureLogOk'] = not missing
result['missingFixturePaths'] = missing
+session_proof = {
+ 'ok': all(r['ok'] and r['toolOk'] and r['fixtureLogOk'] for r in session_results),
+ 'sameAgentReuse': next(r for r in session_results if r['id'] == 'agent-alpha-reuse'),
+ 'crossAgentIsolation': next(r for r in session_results if r['id'] == 'agent-beta-isolated'),
+}
+
summary = {
- 'ok': all(r['ok'] and r['fixtureLogOk'] and r['toolOk'] for r in results) and bool(pinchtab_api_lines),
+ 'ok': all(r['ok'] and r['fixtureLogOk'] and r['toolOk'] for r in results) and session_proof['ok'] and bool(pinchtab_api_lines),
'results': results,
+ 'sessionProof': session_proof,
+ 'sessionScenarios': session_results,
'logEntries': len(entries),
'pinchtabApiCallCount': len(pinchtab_api_lines),
'pinchtabApiSample': pinchtab_api_lines[:10],
diff --git a/tests/manual/openclaw-plugin-smoke/run.sh b/tests/manual/openclaw-plugin-smoke/run.sh
index e21ce34c..0e9aa013 100755
--- a/tests/manual/openclaw-plugin-smoke/run.sh
+++ b/tests/manual/openclaw-plugin-smoke/run.sh
@@ -26,9 +26,13 @@ require_file() {
require_file "$STATE_SOURCE/openclaw.json"
require_file "$STATE_SOURCE/agents/main/agent/auth-profiles.json"
-mkdir -p "$TEMP_STATE/agents/main/agent"
+for agent in main alpha beta; do
+ mkdir -p "$TEMP_STATE/agents/$agent/agent"
+done
cp "$STATE_SOURCE/openclaw.json" "$TEMP_STATE/openclaw.json"
-cp "$STATE_SOURCE/agents/main/agent/auth-profiles.json" "$TEMP_STATE/agents/main/agent/auth-profiles.json"
+for agent in main alpha beta; do
+ cp "$STATE_SOURCE/agents/main/agent/auth-profiles.json" "$TEMP_STATE/agents/$agent/agent/auth-profiles.json"
+done
for dir in credentials identity gateway service-env; do
if [[ -d "$STATE_SOURCE/$dir" ]]; then
cp -R "$STATE_SOURCE/$dir" "$TEMP_STATE/$dir"