refactor(orchestration): remove tool-calls.json and the prompt journal - #638
Merged
Merged
Conversation
Greptile SummaryThis PR removes redundant prompt-journal and per-attempt tool-call persistence while retaining condensed tool traces in memory for continuation prompts and run manifests.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| 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
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>
teriyakichild
force-pushed
the
remove-tool-call-log-and-prompt-journal
branch
from
September 2, 2026 14:43
f16fa75 to
6cb2e88
Compare
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>
Shearerbeard
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonfiles embedded every tool output in full, andappend_tool_callre-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):
load_tool_traces_for_plan→ artifact/tool-chain lines the coordinator sees)TaskSummary.tool_trace(session history,last_tool_callerror context)So instead of deleting the data those features need,
PersistenceWrapper::on_completenow records aToolTraceEntryinto an in-memory per-task map onExecutionPersistence, and both consumers read from that. Behavior of continuation prompts and manifests is unchanged; the on-disk file, the full-output duplication, andToolCallRecordare gone. Full outputs remain available through promoted artifacts and OTel spans.One intentional loss: tool call arguments were stored in
ToolCallRecord.argumentsbut never read by anything; they are now only visible in OTel traces.Prompt journal
The
AURA_PROMPT_JOURNAL-gatedprompt-journal.mdrecorded every coordinator/worker prompt. OTel content recording (OTEL_RECORD_CONTENT) captures the same prompts on theagent.stream/agent.turnspans, and persistence still writes per-workerprompt.txtfiles. Removed the module, the env flag, and the orchestrator'scurrent_iterationatomic (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-commitsvia the runner image: cleanfinal_itemtest helper was missing the newcache_usagefield);cargo test -p aura-web-server --libnow passes (167 tests).Neither surface is documented on the hosted docs (both were dev diagnostics), so no
mezmo/documentationchange should be needed; worth a grep there forAURA_PROMPT_JOURNALbefore merge if unsure.