feat(openab-agent): OPENAB_AGENT_LOG_FILE + richer tool tracing#7
Open
Joseph19820124 wants to merge 1 commit into
Open
feat(openab-agent): OPENAB_AGENT_LOG_FILE + richer tool tracing#7Joseph19820124 wants to merge 1 commit into
Joseph19820124 wants to merge 1 commit into
Conversation
|
All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: This PR will be automatically closed in 3 days if the link is not added. |
openab swallows the agent subprocess's stderr, hiding the existing
`info!("executing tool: ...")` trace. Add an env-driven file sink so
the agent can persist its own log when run under openab, and expand
each tool turn to capture name + input preview + result size/preview.
- `main.rs`: when `OPENAB_AGENT_LOG_FILE` is set, init
tracing-subscriber with `Mutex<File>` writer in append mode
(ANSI off). Falls back to stderr when unset, with a clear error
message if the file can't be opened.
- `agent.rs`: log both `tool call: NAME input=...` (pre) and
`tool result: NAME ok bytes=N preview=...` (post), with a
char-safe truncation helper that also collapses newlines.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b56d743 to
63bc8c2
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds an env-driven file log sink and richer tool tracing to
openab-agent.Why
When
openabspawns the agent subprocess it swallows the child's stderr, hiding the existinginfo!("executing tool: …")traces. This adds a way for the agent to persist its own log, and expands each tool turn so the log is actually useful for debugging.Changes
main.rs— whenOPENAB_AGENT_LOG_FILEis set, initializetracing-subscriberwith aMutex<File>writer in append mode (ANSI off). Falls back to stderr when unset, with a clear error message if the file can't be opened.agent.rs— log both the pre-call (tool call: NAME input=…) and post-call (tool result: NAME ok bytes=N preview=…/error=…) lines, via a char-safepreview()truncation helper that also collapses newlines.Scope & checks
base = upstream-main; diff is exactly 2 files (main.rs,agent.rs, +52/-5). No new env vars beyondOPENAB_AGENT_LOG_FILE, no behavior change when it's unset.cargo build,cargo test(19 passed / 0 failed),cargo fmt --check— clean.Original work by @Joseph19820124 (commit cherry-picked; the
_sigtuple element from that branch's Gemini changes was dropped here so the commit stands alone onupstream-main).🤖 Generated with Claude Code