checkpoint

⚒️ Generated with [Fabro](https://fabro.sh)
This commit is contained in:
Fabro 2026-03-20 19:25:05 -04:00
parent 97d06d7d67
commit e94aae7ede
3 changed files with 114 additions and 12 deletions

View file

@ -1,32 +1,36 @@
{
"timestamp": "2026-03-20T23:25:01.443693Z",
"current_node": "plan",
"timestamp": "2026-03-20T23:25:05.024969Z",
"current_node": "implement",
"completed_nodes": [
"start",
"plan"
"plan",
"implement"
],
"node_retries": {
"implement": 1,
"start": 1,
"plan": 1
},
"context_values": {
"internal.retry_count.implement": 1,
"graph.goal": "https://github.com/fabro-sh/fabro/issues/126",
"outcome": "success",
"outcome": "fail",
"thread.start.current_node": "plan",
"response.plan": "The plan file is located at **`/home/daytona/workspace/plan.md`**.\n\nIt covers the 4 files that need modification across 4 implementation steps:\n\n1. **Add `rand` dependency** to `fabro-agent/Cargo.toml` (workspace dep already exists)\n2. **Replace UUID generation** with `format!(\"{:08x}\", rand::random::<u32>())` in `subagent.rs`\n3. **Remove 5 `short_id` truncation lines** in `fabro-agent/src/cli.rs`, using `agent_id` directly\n4. **Remove 2 `short_id` truncation lines** in `fabro-cli/src/commands/run_progress.rs`, using `agent_id` directly\n\nNo new tests or files are needed — existing tests don't depend on UUID format.",
"failure_signature": "",
"failure_signature": "implement|deterministic|failed to parse child pipeline: parse error: failed to read ../implement/workflow.fabro: no such file or directory (os error <n>)",
"internal.retry_count.start": 1,
"current.preamble": "Goal: https://github.com/fabro-sh/fabro/issues/126\n",
"internal.thread_id": "start",
"current.preamble": "Goal: https://github.com/fabro-sh/fabro/issues/126\nRun ID: 01KM6RYWXA9TZ4GFKQT99NF7A7\nPipeline progress: 1 of 2 stages completed\n\n## Stage: plan\n- Status: success\n- Handler: agent\n- Model: claude-opus-4-6\n- Tokens: 15.4k in / 2.7k out\n- Files touched: /home/daytona/workspace/plan.md\n- Response:\n > The plan file is located at **`/home/daytona/workspace/plan.md`**.\n > \n > It covers the 4 files that need modification across 4 implementation steps:\n > \n > 1. **Add `rand` dependency** to `fabro-agent/Cargo.toml` (workspace dep already exists)\n > 2. **Replace UUID generation** with `format!(\"{:08x}\", rand::random::<u32>())` in `subagent.rs`\n > 3. **Remove 5 `short_id` truncation lines** in `fabro-agent/src/cli.rs`, using `agent_id` directly\n > 4. **Remove 2 `short_id` truncation lines** in `fabro-cli/src/commands/run_progress.rs`, using `agent_id` directly\n > \n > No new tests or files are needed — existing tests don't depend on UUID format.\n",
"internal.thread_id": "plan",
"thread.plan.current_node": "implement",
"internal.node_visit_count": 1,
"internal.fidelity": "compact",
"internal.fidelity": "summary:high",
"graph.model_stylesheet": "\n * { model: claude-opus-4-6; }\n ",
"internal.retry_count.plan": 1,
"failure_class": "",
"failure_class": "deterministic",
"graph.rankdir": "LR",
"internal.run_id": "01KM6RYWXA9TZ4GFKQT99NF7A7",
"last_stage": "plan",
"current_node": "plan",
"current_node": "implement",
"last_response": "The plan file is located at **`/home/daytona/workspace/plan.md`**.\n\nIt covers the 4 files that need modification across 4 implementation steps:\n\n1. **Add `rand` dependency** to `fabro-agent/Cargo.toml"
},
"logs": [],
@ -53,14 +57,26 @@
],
"duration_ms": 95761
},
"implement": {
"status": "fail",
"failure": {
"message": "Failed to parse child pipeline: Parse error: Failed to read ../implement/workflow.fabro: No such file or directory (os error 2)",
"failure_class": "deterministic"
},
"duration_ms": 0
},
"start": {
"status": "success",
"duration_ms": 0
}
},
"next_node_id": "implement",
"next_node_id": "exit",
"loop_failure_signatures": {
"implement|deterministic|failed to parse child pipeline: parse error: failed to read ../implement/workflow.fabro: no such file or directory (os error <n>)": 1
},
"node_visits": {
"start": 1,
"plan": 1
"plan": 1,
"implement": 1
}
}

View file

@ -0,0 +1,6 @@
{
"status": "fail",
"notes": null,
"failure_reason": "Failed to parse child pipeline: Parse error: Failed to read ../implement/workflow.fabro: No such file or directory (os error 2)",
"timestamp": "2026-03-20T23:25:05.024719+00:00"
}

80
nodes/plan/diff.patch Normal file
View file

@ -0,0 +1,80 @@
diff --git a/plan.md b/plan.md
new file mode 100644
index 00000000..ca795485
--- /dev/null
+++ b/plan.md
@@ -0,0 +1,74 @@
+# Plan: Use short hex IDs for subagents instead of UUIDs
+
+## Issue Summary
+
+GitHub Issue #126: Subagent IDs are currently full UUID v4 strings (36 chars, e.g. `550e8400-e29b-41d4-a716-446655440000`). These appear in CLI output and must be passed back by the LLM to tools like `send_input`, `wait`, and `close_agent`. A shorter, random 8-character hex string (e.g. `a3f1b20c`) is easier to read and less error-prone. The codebase already truncates agent IDs to 8 chars in multiple display locations — this change makes the canonical ID match what's already shown.
+
+## Files to Modify
+
+1. **`lib/crates/fabro-agent/Cargo.toml`** — Add `rand` dependency (already a workspace dep).
+2. **`lib/crates/fabro-agent/src/subagent.rs`** — Replace UUID generation with 8-char hex.
+3. **`lib/crates/fabro-agent/src/cli.rs`** — Remove 5 instances of `short_id` truncation; use `agent_id` directly.
+4. **`lib/crates/fabro-cli/src/commands/run_progress.rs`** — Remove 2 instances of `short_id` truncation; use `agent_id` directly.
+
+No files need to be created.
+
+## Step-by-step Implementation
+
+### Step 1: Add `rand` to `fabro-agent` dependencies
+
+In `lib/crates/fabro-agent/Cargo.toml`, add `rand.workspace = true` to `[dependencies]`. The `rand = "0.8"` workspace dependency already exists in the root `Cargo.toml`.
+
+Note: Do **not** remove `uuid` — it is still used for session IDs in `session.rs:58`.
+
+### Step 2: Replace UUID with random hex in `subagent.rs`
+
+In `lib/crates/fabro-agent/src/subagent.rs`, line 67, change:
+
+```rust
+let agent_id = uuid::Uuid::new_v4().to_string();
+```
+
+to:
+
+```rust
+let agent_id = format!("{:08x}", rand::random::<u32>());
+```
+
+This generates an 8-character lowercase hex string from a random `u32` (~4 billion possible values, effectively collision-free within a session).
+
+### Step 3: Remove `short_id` truncation in `cli.rs`
+
+In `lib/crates/fabro-agent/src/cli.rs`, there are 5 occurrences of `let short_id = &agent_id[..8.min(agent_id.len())];` (lines 542, 561, 574, 583, 596). Since the agent ID is now exactly 8 chars, these truncation lines are redundant. For each occurrence:
+
+- Remove the `let short_id = ...` line.
+- Replace all uses of `short_id` with `agent_id` in the surrounding format strings.
+
+The 5 locations are inside match arms for:
+1. `AgentEvent::SubAgentSpawned` (line 542)
+2. `AgentEvent::SubAgentCompleted` (line 561)
+3. `AgentEvent::SubAgentFailed` (line 574)
+4. `AgentEvent::SubAgentClosed` (line 583)
+5. `AgentEvent::SubAgentEvent` (line 596, inside `if verbose` guard)
+
+### Step 4: Remove `short_id` truncation in `run_progress.rs`
+
+In `lib/crates/fabro-cli/src/commands/run_progress.rs`, there are 2 occurrences of `let short_id = &agent_id[..agent_id.len().min(8)];` (lines 1416, 1432). For each:
+
+- Remove the `let short_id = ...` line.
+- Replace `short_id` with `agent_id` in the surrounding format strings.
+
+The 2 locations are inside match arms for:
+1. `AgentEvent::SubAgentSpawned` (line 1416)
+2. `AgentEvent::SubAgentCompleted` (line 1432)
+
+## Verification / Test Cases
+
+No new tests are needed. Existing tests use hardcoded IDs (like `"sa-1"`, `"nonexistent-id"`, `"x"`) and don't depend on the UUID format. The spawn test (`spawn_creates_agent_and_returns_id`) asserts the ID is non-empty, which still passes.
+
+Run these commands to verify:
+
+1. `cargo test -p fabro-agent` — all subagent tests pass
+2. `cargo test -p fabro-cli` — run_progress tests pass
+3. `cargo clippy --workspace -- -D warnings` — no warnings
+4. `cargo build --workspace` — clean build