Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cargo build --release
cargo test
```

Integration tests share `tests/support/` (env-isolated `TestEnv`, payload builders, in-process fake Langfuse). `tests/concurrency_test.rs` is the Track 2 race suite; tests `#[ignore]`d "red until fix-state-locking" are expected failures demonstrating the non-blocking-flock bug. `CODE_TRACE_SYNC_SEND=1` makes sends inline (no fork) for exact delivery assertions. The Track 1 container harness (real `claude` + stub model API + fake Langfuse) lives in `harness/` — see `harness/README.md`.
Integration tests share `tests/support/` (env-isolated `TestEnv`, payload builders, in-process fake Langfuse). `tests/concurrency_test.rs` is the Track 2 race suite; tests `#[ignore]`d "red until fix-state-locking" are expected failures demonstrating the non-blocking-flock bug. `tests/source_system_test.rs` covers system-level OpenCode and PiAgent pipelines (stdin → binary → fake Langfuse), mirroring the Claude Code coverage in `cli_test.rs`/`concurrency_test.rs`. `CODE_TRACE_SYNC_SEND=1` makes sends inline (no fork) for exact delivery assertions. The Track 1 container harness (real `claude` + stub model API + fake Langfuse) lives in `harness/` — see `harness/README.md`.

## Adding a new source

Expand Down
17 changes: 17 additions & 0 deletions src/turns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ pub fn build_turns(messages: Vec<Value>) -> Vec<Turn> {
if !assistant_latest.contains_key(&mid) {
assistant_order.push(mid.clone());
}
// Tool results for OpenCode/PiAgent are attached to the assistant
// message itself (message.tool_results) by the source normalizers,
// not delivered as separate user messages like Claude Code. Extract
// them here so emit.rs can populate tool-span outputs. Additive:
// Claude Code assistant messages never carry this field.
if let Some(trs) = msg
.get("message")
.and_then(|m| m.get("tool_results"))
.and_then(|v| v.as_array())
{
for tr in trs {
if let Some(tid) = tr.get("tool_use_id").and_then(|v| v.as_str()) {
let content = tr.get("content").cloned().unwrap_or(Value::Null);
tool_results_by_id.insert(tid.to_string(), content);
}
}
}
assistant_latest.insert(mid, msg);
continue;
}
Expand Down
Loading