Conversation
MANAGER was an orthogonal capability ("can spawn sub-agents") that got
implemented as a mutually exclusive role. Rename to COORDINATOR to
accurately describe the delegation/coordination role, freeing MANAGER
semantics for the upcoming capability flag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add optional `manager: boolean` field to AgentIdentity. Self-reported flag indicating the agent can spawn sub-agents. Stored on registration, returned via whoami. Does not change available operations — signals capability to other agents and the coordinator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace CommonJS require() with proper ESM imports in storage.ts (RevisionIndexBuilder) and claude-folder-integration.ts (statSync). Fixes "require is not defined" warning in ESM context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The priming resource block (mental models for profiled agents) was being appended to every thought response, causing massive token waste. Added a sessionsPrimed set to GatewayHandler keyed by agentId:sessionId to ensure priming is sent only once per session. Fixes thoughtbox-308 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The last thought had nextThoughtNeeded: false which closed the session before the test could capture the sessionId, causing all 9 branch retrieval tests to fail with "No session created". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… bounds validation The JS falsy check `!data.branchFromThought` treated 0 as missing, giving agents a misleading "branchId requires branchFromThought" error instead of the correct "must be >= 1" bounds error. Also fixes wrong operation names and arg shapes in all 3 hub agent instruction files that caused agents to call nonexistent operations during demos. Changes: - Fix falsy check to use explicit undefined/null comparison - Add branchFromThought >= 1 bounds validation with clear error message - Rewrite hub-architect.md Phase 2-3: init→get_state, new_thought→thought, create_proposal uses sourceBranch not thoughtRef, post_message uses workspaceId+problemId not channelId - Rewrite hub-debugger.md Phase 2-3: same corrections as architect - Fix hub-coordinator.md: mark_consensus thoughtRef is a number not object, post_message uses workspaceId+problemId, merge_proposal needs workspaceId - Add 2 test cases for branchFromThought validation - Reset corrupted .claude/state/memory-calibration.json (gitignored) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
🤖 Augment PR SummarySummary: This PR renames the hub “MANAGER” role/profile to “COORDINATOR” and tightens hub/gateway behavior around branching and profile priming. Changes:
Technical Notes: Updates multiple tests to reflect the new coordinator profile name and the once-per-session priming behavior. 🤖 Was this summary useful? React with 👍 or 👎 |
| private sessionAgentIds = new Map<string, string>(); | ||
| private sessionAgentNames = new Map<string, string>(); | ||
| /** Track sessions that have already received profile priming (once-per-session) */ | ||
| private sessionsPrimed = new Set<string>(); |
There was a problem hiding this comment.
sessionsPrimed will grow for every unique (agentId, sessionId) and is never cleared, which can become an unbounded memory footprint in a long-lived server. Consider adding a cleanup path when sessions are ended/expired (similar to any cleanup for sessionAgentIds/sessionAgentNames).
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| } | ||
|
|
||
| // Validate branchFromThought is >= 1 (thoughts are 1-indexed) | ||
| if (data.branchFromThought !== undefined && data.branchFromThought !== null && data.branchFromThought < 1) { |
There was a problem hiding this comment.
This adds the branchFromThought >= 1 check, but branchFromThought still isn’t type-validated; values like NaN/non-numeric strings can slip through and then be treated as a number via casts. Consider explicitly validating typeof data.branchFromThought === 'number' when it’s provided.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| WORKSPACE_DESC="Multi-agent collaboration demo: COORDINATOR decomposes problems, ARCHITECT designs solutions, DEBUGGER investigates bugs" | ||
| WORKSPACE_ID_FILE="/tmp/hub-demo-workspace-id.txt" | ||
| MANAGER_OUTPUT_FILE="/tmp/hub-demo-manager-output.txt" | ||
| COORDINATOR_OUTPUT_FILE="/tmp/hub-demo-manager-output.txt" |
There was a problem hiding this comment.
COORDINATOR_OUTPUT_FILE still points to /tmp/hub-demo-manager-output.txt, which can overwrite/consume stale “manager” output across runs and is confusing when debugging. Consider renaming the temp filename to match the coordinator terminology.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Greptile OverviewGreptile SummaryThis PR completes a MANAGER → COORDINATOR rename across hub profiles, docs, and tests; introduces a new The core runtime impact is in the hub identity layer ( Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
autonumber
actor Client as MCP Client
participant Server as Thoughtbox Server
participant Gateway as GatewayHandler
participant Thought as ThoughtHandler
participant Hub as HubHandler
participant Identity as IdentityManager
Client->>Server: thoughtbox_hub.register(name, profile, manager?)
Server->>Hub: handle('register', args)
Hub->>Identity: register({name, profile, manager?})
Identity-->>Hub: {agentId, name, role}
Hub-->>Client: registration result
Client->>Server: thoughtbox_gateway.thought(args, mcpSessionId)
Server->>Gateway: handle({operation:'thought', args}, mcpSessionId)
Gateway->>Thought: processThought({...args, agentId?, agentName?})
Thought-->>Gateway: result {content[], isError}
alt result.isError == false AND getAgentProfile available
Gateway->>Gateway: compute primingKey = agentId + ':' + sessionId
alt primingKey not in sessionsPrimed
Gateway->>Hub: getAgentProfile(agentId)
Hub-->>Gateway: profileName
Gateway->>Gateway: getProfilePriming(profileName)
Gateway-->>Client: content + priming resource
Gateway->>Gateway: sessionsPrimed.add(primingKey)
else already primed
Gateway-->>Client: content (no priming)
end
else error or no profile
Gateway-->>Client: content (no priming)
end
Note over Thought: branch validation updated:
Note over Thought: - branchId requires branchFromThought (undefined/null)
Note over Thought: - branchFromThought must be >= 1
|
GATEWAY_DESCRIPTION: add missing operations (read_thoughts, get_structure, knowledge) and arg summaries for all 15 operations, grouped by stage. HUB_TOOL_DESCRIPTION: explain manager flag purpose, profile meanings, mark coordinator-only ops, group by lifecycle stage. THOUGHTBOX_INSTRUCTIONS: expand hub section with workflow sequence, profile examples, and manager flag documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 3e9f550.
| @@ -37,6 +38,7 @@ export function createIdentityManager(storage: HubStorage): IdentityManager { | |||
| name, | |||
There was a problem hiding this comment.
Manager flag drops false
register() only persists the manager capability when it’s truthy (...(manager && { manager })), and whoami() only returns it when truthy (if (agent.manager)). This makes an explicit manager: false indistinguishable from undefined, which breaks boolean semantics for a capability flag. Consider checking manager !== undefined / agent.manager !== undefined instead so false round-trips correctly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/hub/identity.ts
Line: 35:38
Comment:
**Manager flag drops false**
`register()` only persists the `manager` capability when it’s truthy (`...(manager && { manager })`), and `whoami()` only returns it when truthy (`if (agent.manager)`). This makes an explicit `manager: false` indistinguishable from `undefined`, which breaks boolean semantics for a capability flag. Consider checking `manager !== undefined` / `agent.manager !== undefined` instead so `false` round-trips correctly.
How can I resolve this? If you propose a fix, please make it concise.
No description provided.