Open
Conversation
New CLI command for tracing AI agents and tools that modify the working tree. Unlike `roar run`, it does not require a clean git state or even a git repository. - `roar agent <cmd>` traces file I/O and records job_type="agent" - Process tree stored in job metadata, rendered by `roar show` - Git info captured best-effort (graceful when outside a repo) - Suppressed git stderr noise from provider's get_status Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The preload tracer previously only discovered processes when they performed file I/O. Short-lived children like `ls` were invisible. Add Fork and Exec variants to NativeTraceEvent. Interpose fork() in the C shim so the launcher learns about child processes immediately. A library constructor sends an Exec event after successful exec, carrying the new command from /proc/self/cmdline. The launcher reconciles out-of-order Exec-before-Fork by back-filling parent_pid when the Fork event arrives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Detail
Reuses the entire run pipeline (tracer → provenance → job recording → report) with two differences:
Git info captured best-effort; _get_git_info returns {} outside a repo. Git provider get_status stderr leak suppressed.
Process tree display
The summarized process tree is stored in job metadata as process_tree. roar show renders:
Preload fork/exec
Two new NativeTraceEvent variants: Fork { parent_pid, child_pid } and Exec { pid, command }. C shim interposes fork(), library constructor sends Exec with /proc/self/cmdline after successful exec. Launcher reconciles out-of-order events by back-filling parent_pid.
Known limitation: clone3/posix_spawn (used by glibc system() and Python subprocess) bypass fork() interposition.
Shell commands work correctly since bash uses libc fork().
Test plan
🤖 Generated with https://claude.com/claude-code