diff --git a/.trajectories/active/traj_49mvfl01ogcy.json b/.trajectories/active/traj_49mvfl01ogcy.json deleted file mode 100644 index ab3625dd9..000000000 --- a/.trajectories/active/traj_49mvfl01ogcy.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "id": "traj_49mvfl01ogcy", - "version": 1, - "task": { - "title": "Fix MCP tools not available for agents spawned via agent_add" - }, - "status": "active", - "startedAt": "2026-03-19T13:58:53.083Z", - "agents": [ - { - "name": "default", - "role": "lead", - "joinedAt": "2026-03-19T13:59:03.645Z" - } - ], - "chapters": [ - { - "id": "chap_47z9bxqpen38", - "title": "Work", - "agentName": "default", - "startedAt": "2026-03-19T13:59:03.645Z", - "events": [ - { - "ts": 1773928743645, - "type": "decision", - "content": "Two root causes: (1) --strict-mcp-config blocked .mcp.json loading for Claude agents, (2) WS AgentSpawnRequested path had no agent pre-registration: Two root causes: (1) --strict-mcp-config blocked .mcp.json loading for Claude agents, (2) WS AgentSpawnRequested path had no agent pre-registration", - "raw": { - "question": "Two root causes: (1) --strict-mcp-config blocked .mcp.json loading for Claude agents, (2) WS AgentSpawnRequested path had no agent pre-registration", - "chosen": "Two root causes: (1) --strict-mcp-config blocked .mcp.json loading for Claude agents, (2) WS AgentSpawnRequested path had no agent pre-registration", - "alternatives": [], - "reasoning": "SDK spawn_agent path pre-registered tokens and worked fine. WS agent_add path skipped pre-registration because it expected the WS event to carry a token, but AgentSpawnRequestedPayload struct has no token field. Without a token, MCP server failed to connect." - }, - "significance": "high" - }, - { - "ts": 1773928753544, - "type": "decision", - "content": "Removed --strict-mcp-config from Claude MCP injection, added broker-side pre-registration to WS spawn handlers: Removed --strict-mcp-config from Claude MCP injection, added broker-side pre-registration to WS spawn handlers", - "raw": { - "question": "Removed --strict-mcp-config from Claude MCP injection, added broker-side pre-registration to WS spawn handlers", - "chosen": "Removed --strict-mcp-config from Claude MCP injection, added broker-side pre-registration to WS spawn handlers", - "alternatives": [], - "reasoning": "For Claude: --mcp-config is additive (only relaycast), Claude loads .mcp.json separately. For all CLIs: broker now calls register_agent_token before spawning via WS path, matching the SDK path behavior." - }, - "significance": "high" - } - ] - } - ], - "commits": [], - "filesChanged": [], - "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relay", - "tags": [], - "_trace": { - "startRef": "18d8bb9839d9991bbfb47db3d99bb8eccaa20fe7", - "endRef": "18d8bb9839d9991bbfb47db3d99bb8eccaa20fe7" - } -} \ No newline at end of file diff --git a/.trajectories/completed/2026-03/traj_u6bndffr0b8g.json b/.trajectories/active/traj_u6bndffr0b8g.json similarity index 85% rename from .trajectories/completed/2026-03/traj_u6bndffr0b8g.json rename to .trajectories/active/traj_u6bndffr0b8g.json index a6313130e..39884a17c 100644 --- a/.trajectories/completed/2026-03/traj_u6bndffr0b8g.json +++ b/.trajectories/active/traj_u6bndffr0b8g.json @@ -4,7 +4,7 @@ "task": { "title": "Code review for assigned workflow changes" }, - "status": "abandoned", + "status": "active", "startedAt": "2026-03-12T08:38:19.960Z", "agents": [], "chapters": [], @@ -15,6 +15,5 @@ "_trace": { "startRef": "4ce7ccf5e297e46ededaf74c2a997cfe0d2f88af", "endRef": "4ce7ccf5e297e46ededaf74c2a997cfe0d2f88af" - }, - "completedAt": "2026-03-19T13:58:52.857Z" + } } \ No newline at end of file diff --git a/.trajectories/completed/2026-03/traj_u6bndffr0b8g.md b/.trajectories/completed/2026-03/traj_u6bndffr0b8g.md deleted file mode 100644 index 9c900983e..000000000 --- a/.trajectories/completed/2026-03/traj_u6bndffr0b8g.md +++ /dev/null @@ -1,5 +0,0 @@ -# Trajectory: Code review for assigned workflow changes - -> **Status:** ❌ Abandoned -> **Started:** March 12, 2026 at 09:38 AM -> **Completed:** March 19, 2026 at 02:58 PM diff --git a/.trajectories/index.json b/.trajectories/index.json index 92eccf6df..12779d018 100644 --- a/.trajectories/index.json +++ b/.trajectories/index.json @@ -1,6 +1,6 @@ { "version": 1, - "lastUpdated": "2026-03-19T13:59:13.544Z", + "lastUpdated": "2026-03-14T21:19:05.674Z", "trajectories": { "traj_1b1dj40sl6jl": { "title": "Revert aggressive retry logic in relay-pty-orchestrator", @@ -835,19 +835,6 @@ "startedAt": "2026-03-14T21:15:58.670Z", "completedAt": "2026-03-14T21:19:05.548Z", "path": "/Users/khaliqgant/Projects/relay/.trajectories/completed/2026-03/traj_qu5fbj9hzhdz.json" - }, - "traj_u6bndffr0b8g": { - "title": "Code review for assigned workflow changes", - "status": "abandoned", - "startedAt": "2026-03-12T08:38:19.960Z", - "completedAt": "2026-03-19T13:58:52.857Z", - "path": "/Users/khaliqgant/Projects/AgentWorkforce/relay/.trajectories/completed/2026-03/traj_u6bndffr0b8g.json" - }, - "traj_49mvfl01ogcy": { - "title": "Fix MCP tools not available for agents spawned via agent_add", - "status": "active", - "startedAt": "2026-03-19T13:58:53.083Z", - "path": "/Users/khaliqgant/Projects/AgentWorkforce/relay/.trajectories/active/traj_49mvfl01ogcy.json" } } } \ No newline at end of file diff --git a/src/snippets.rs b/src/snippets.rs index b2df8ed76..54a1a6040 100644 --- a/src/snippets.rs +++ b/src/snippets.rs @@ -267,6 +267,7 @@ pub fn relaycast_mcp_config_json_with_token( /// /// Later sources override earlier ones (matching Claude's own precedence). /// The relaycast entry always wins (prevents stale entries from overriding broker creds). +#[allow(dead_code)] fn merge_relaycast_with_project_mcp( relay_api_key: Option<&str>, relay_base_url: Option<&str>, @@ -289,6 +290,7 @@ fn merge_relaycast_with_project_mcp( } /// Inner implementation that accepts an explicit home directory for testability. +#[allow(dead_code)] #[allow(clippy::too_many_arguments)] fn merge_relaycast_with_project_mcp_inner( relay_api_key: Option<&str>, diff --git a/workflows/polish-workflow-output.ts b/workflows/polish-workflow-output.ts index 769aee95b..5e3394de4 100644 --- a/workflows/polish-workflow-output.ts +++ b/workflows/polish-workflow-output.ts @@ -1,7 +1,12 @@ +import { execSync } from 'node:child_process'; import { workflow, createWorkflowRenderer } from '@agent-relay/sdk/workflows'; const renderer = createWorkflowRenderer(); +try { + execSync('npx trail start "Polish workflow output with listr2 + chalk"', { stdio: 'ignore' }); +} catch {} + const [result] = await Promise.all([ workflow('polish-workflow-output') .description('Replace plain console.log workflow output with listr2 + chalk for a polished CLI experience') @@ -119,10 +124,10 @@ package.json). Use the latest chalk version (v5+) with standard ESM imports. {{steps.read-package-json.output}} Produce a detailed implementation plan covering: -1. Exact npm install command (listr2 version, chalk@4 pinned) +1. Exact npm install command (listr2 version, latest chalk with ESM imports) 2. Complete new implementation for \`cli.ts\` (write the full file) 3. Exact before/after replacements for the 3 runner.ts locations -4. TypeScript import style for chalk and listr2 in CJS context +4. TypeScript import style for chalk and listr2 in ESM context 5. How the listr2 task map is keyed (stepName → task) and updated per event 6. How step:owner-assigned, step:retrying, step:nudged events render as subtask output lines rather than top-level tasks @@ -135,7 +140,7 @@ PLAN_COMPLETE`, .step('install-deps', { type: 'deterministic', dependsOn: ['plan'], - command: 'cd packages/sdk && npm install listr2 chalk@4 2>&1 && echo "exit=0"', + command: 'cd packages/sdk && npm install listr2 chalk 2>&1 && echo "exit=0"', captureOutput: true, failOnError: true, }) @@ -246,4 +251,12 @@ Approve when the implementation is complete and working.`, ]); renderer.unmount(); +try { + if (result.status === 'completed') { + execSync('npx trail complete --summary "Polished workflow output with listr2 + chalk" --confidence 0.88', { stdio: 'ignore' }); + } else { + execSync(`npx trail abandon --reason "Workflow ended with status: ${result.status}"`, { stdio: 'ignore' }); + } +} catch {} + console.log('Result:', result.status);