Skip to content

Commit 8dcebc9

Browse files
feat(proxy): add _agent_c to multiagent namespace isolation (DAK-6952) (#228)
Support 3-agent pipeline in Multi-Agent Memory Sharing mode. Agent C (Analytics) shares the same namespace as Agent A and B so all three agents can access shared memories. Tests updated: 60/60 pass. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e8ed674 commit 8dcebc9

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

docker/playground/proxy/namespace.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const NS_PREFIX = 'playground-demo';
3131
// Frontend agent_ids follow the pattern `pg_XXXXXX_<suffix>` where the suffix
3232
// identifies the scenario. We map suffixes to scenario keys so that:
3333
// - each scenario gets its own isolated namespace
34-
// - _agent_a and _agent_b share a namespace (multi-agent demo feature)
34+
// - _agent_a, _agent_b, and _agent_c share a namespace (multi-agent demo feature)
3535
// - all _llm_* variants share a namespace (they seed different agent_ids)
3636
// - `playground-demo` (API Explorer auto-seed) maps to `default`
3737

@@ -47,8 +47,8 @@ function scenarioKey(agentId) {
4747
// Exact match for the base playground-demo id (API Explorer / auto-seed)
4848
if (agentId === NS_PREFIX || agentId === 'playground-demo') return 'default';
4949

50-
// Multi-agent: _agent_a and _agent_b share a namespace
51-
if (agentId.endsWith('_agent_a') || agentId.endsWith('_agent_b')) return 'multiagent';
50+
// Multi-agent: _agent_a, _agent_b, and _agent_c share a namespace
51+
if (agentId.endsWith('_agent_a') || agentId.endsWith('_agent_b') || agentId.endsWith('_agent_c')) return 'multiagent';
5252

5353
// All LLM compare variants share one namespace
5454
if (/_llm_/.test(agentId)) return 'llm';

docker/playground/proxy/proxy.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,10 @@ test('scenarioKey extracts correct keys from agent_ids (DAK-6929)', () => {
468468
assert.equal(scenarioKey('pg_abcdef_llm_legal'), 'llm');
469469
assert.equal(scenarioKey('pg_abcdef_llm_devops'), 'llm');
470470

471-
// Multi-agent: _agent_a and _agent_b both map to 'multiagent'
471+
// Multi-agent: _agent_a, _agent_b, and _agent_c all map to 'multiagent'
472472
assert.equal(scenarioKey('pg_abcdef_agent_a'), 'multiagent');
473473
assert.equal(scenarioKey('pg_abcdef_agent_b'), 'multiagent');
474+
assert.equal(scenarioKey('pg_abcdef_agent_c'), 'multiagent');
474475

475476
// Arbitrary suffix extraction — the regex `pg_[A-Za-z0-9_-]{6,}_(.+)$` is
476477
// greedy, so `[A-Za-z0-9_-]{6,}` consumes as much as possible including
@@ -501,11 +502,13 @@ test('sessionNamespace produces different namespaces for different scenarios (DA
501502
}
502503
});
503504

504-
test('multi-agent _agent_a and _agent_b share the same namespace (DAK-6929)', () => {
505+
test('multi-agent _agent_a, _agent_b, and _agent_c share the same namespace (DAK-6952)', () => {
505506
const session = 'pg_multitest';
506507
const nsA = sessionNamespace(session, 'pg_multitest_agent_a');
507508
const nsB = sessionNamespace(session, 'pg_multitest_agent_b');
509+
const nsC = sessionNamespace(session, 'pg_multitest_agent_c');
508510
assert.equal(nsA, nsB, '_agent_a and _agent_b must share a namespace for cross-agent demo');
511+
assert.equal(nsB, nsC, '_agent_c must also share the same namespace for 3-agent pipeline');
509512
});
510513

511514
test('LLM variants all share the same namespace (DAK-6929)', () => {

0 commit comments

Comments
 (0)