Skip to content

refactor(orchestration): remove tool-calls.json and the prompt journal - #638

Merged
teriyakichild merged 3 commits into
nightlyfrom
remove-tool-call-log-and-prompt-journal
Sep 2, 2026
Merged

refactor(orchestration): remove tool-calls.json and the prompt journal#638
teriyakichild merged 3 commits into
nightlyfrom
remove-tool-call-log-and-prompt-journal

Conversation

@teriyakichild

@teriyakichild teriyakichild commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Removes two persistence surfaces that predate OTel support and now duplicate what tracing provides.

Fixes: #637
Refs: #636

tool-calls.json → in-memory tool traces

The per-attempt tool-calls.json files embedded every tool output in full, and append_tool_call re-read, re-parsed, and rewrote the whole file on each call while holding the shared persistence mutex. This was the fourth on-disk copy of large tool outputs described in #636, and the one with quadratic write growth.

The file had two runtime consumers, and both only read the condensed form (tool name, reasoning, duration, outcome byte count, artifact filename):

  • continuation-prompt rendering (load_tool_traces_for_plan → artifact/tool-chain lines the coordinator sees)
  • the run manifest's TaskSummary.tool_trace (session history, last_tool_call error context)

So instead of deleting the data those features need, PersistenceWrapper::on_complete now records a ToolTraceEntry into an in-memory per-task map on ExecutionPersistence, and both consumers read from that. Behavior of continuation prompts and manifests is unchanged; the on-disk file, the full-output duplication, and ToolCallRecord are gone. Full outputs remain available through promoted artifacts and OTel spans.

One intentional loss: tool call arguments were stored in ToolCallRecord.arguments but never read by anything; they are now only visible in OTel traces.

Prompt journal

The AURA_PROMPT_JOURNAL-gated prompt-journal.md recorded every coordinator/worker prompt. OTel content recording (OTEL_RECORD_CONTENT) captures the same prompts on the agent.stream/agent.turn spans, and persistence still writes per-worker prompt.txt files. Removed the module, the env flag, and the orchestrator's current_iteration atomic (its only reader was the journal).

Testing

  • cargo test -p aura -p aura-config -p aura-events -p aura-cli: all green (1078 aura lib tests, incl. rewritten trace tests)
  • cargo +nightly fmt --check, cargo clippy --workspace, make lint-commits via the runner image: clean
  • Also fixes the pre-existing web-server lib test compile break on nightly (the final_item test helper was missing the new cache_usage field); cargo test -p aura-web-server --lib now passes (167 tests).

Neither surface is documented on the hosted docs (both were dev diagnostics), so no mezmo/documentation change should be needed; worth a grep there for AURA_PROMPT_JOURNAL before merge if unsure.

@teriyakichild
teriyakichild requested a review from a team as a code owner September 2, 2026 14:36
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes redundant prompt-journal and per-attempt tool-call persistence while retaining condensed tool traces in memory for continuation prompts and run manifests.

  • Replaces tool-calls.json reads and writes with shared in-memory ToolTraceEntry storage.
  • Removes the prompt journal, its environment flag, and iteration-tracking state.
  • Updates persistence-wrapper tests to validate in-memory trace recording and fixes the web-server test initializer.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/aura/src/orchestration/persistence.rs Replaces persisted full tool-call records with a clone-shared, in-memory condensed trace map; the previously flagged field comment is now value-focused.
crates/aura/src/orchestration/persistence_wrapper.rs Records condensed success or error outcomes directly into execution persistence while retaining artifact promotion.
crates/aura/src/orchestration/orchestrator.rs Removes prompt-journal integration and switches continuation and manifest construction to in-memory tool traces.
crates/aura/src/orchestration/prompt_journal.rs Deletes the obsolete prompt-journal implementation and its tests.
crates/aura-web-server/src/streaming/handlers.rs Updates the test-only FinalResponseInfo initializer with the required cache_usage field.

Reviews (2): Last reviewed commit: "test(web-server): add cache_usage to the..." | Re-trigger Greptile

Comment thread crates/aura/src/orchestration/persistence.rs
Comment thread crates/aura/src/orchestration/persistence.rs Outdated
The per-attempt tool-calls.json files duplicated every tool output in
full: each record embedded the complete clean output, and every append
re-read, re-parsed, and rewrote the whole file, so bytes written grew
quadratically with call count and multi-MB outputs went through JSON
string escaping on every subsequent call in the attempt. All of that
happened while holding the shared persistence mutex, blocking every
other worker's completion hook. OTel spans now cover the debugging
role these files served.

The two runtime consumers only ever read the condensed form (tool
name, reasoning, duration, outcome byte count, artifact filename), so
record ToolTraceEntry directly into an in-memory per-task map on
ExecutionPersistence. Continuation-prompt rendering and the run
manifest's tool_trace read from that map; full outputs remain
available via promoted artifacts and OTel. ToolCallRecord and its
append/load paths are gone.

Refs: #636
Refs: #637
Signed-off-by: Tony Rogers <tony@tonyrogers.me>
The AURA_PROMPT_JOURNAL-gated prompt-journal.md predates OTel support.
With content recording (OTEL_RECORD_CONTENT), every coordinator and
worker prompt is captured on the agent.stream/agent.turn spans, so the
journal duplicates what tracing already provides. The per-worker
prompt.txt files written by execution persistence also remain.

Removes the module, the env flag, and the orchestrator's
current_iteration atomic, whose only reader was the journal.

Fixes: #637
Signed-off-by: Tony Rogers <tony@tonyrogers.me>
The lib test target stopped compiling when FinalResponseInfo gained
the cache_usage field: the streaming handler tests' final_item helper
still built the struct without it. The tests exercise the aggregated
usage path, so a bare None matches what they simulated before.

Refs: #630
Signed-off-by: Tony Rogers <tony@tonyrogers.me>
@teriyakichild
teriyakichild merged commit bc1aa37 into nightly Sep 2, 2026
10 checks passed
@teriyakichild
teriyakichild deleted the remove-tool-call-log-and-prompt-journal branch September 2, 2026 15:23
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants