feat(acp): Add ACP traffic tracing via sacp-tee proxy#158
Closed
feat(acp): Add ACP traffic tracing via sacp-tee proxy#158
Conversation
Add a debugging feature to capture all JSON-RPC 2.0 traffic between the
Nori client and ACP agents using the sacp-tee proxy from symposium-acp.
When enabled via --acp-trace CLI flag or acp.trace_enabled in config.toml,
the agent subprocess command is wrapped with:
sacp-tee --log-file <path> -- <original-command> <args>
Key changes:
- Add AcpTraceConfig struct and build_agent_command() in connection.rs
- Add trace_config field to AcpBackendConfig in backend.rs
- Add acp_trace_enabled field to Config, AcpConfigToml, ConfigOverrides
- Add --acp-trace CLI flag to TUI
- Generate session-specific log files: {codex_home}/log/acp-trace-{ts}-{pid}.log
- Add 8 tests covering config, CLI override, and command wrapping
- Update docs.md files for acp, core, and tui modules
Config priority: CLI override > TOML config > default (false)
🤖 Generated with [Nori](https://nori.ai)
Co-Authored-By: Nori <contact@tilework.tech>
Fix clippy::uninlined_format_args warnings in: - acp/src/config/types.rs: acp_trace_log_path format string - acp/src/connection.rs: spawn error message format string 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <contact@tilework.tech>
Resolved conflicts by preserving both feature sets: - ACP traffic tracing (current branch via sacp-tee proxy) - Message history persistence (dev branch) Changes: - Added both trace_config and nori_home/history_persistence fields to AcpBackendConfig - Added both acp_trace_enabled and history_persistence to config types - Preserved enhanced error handling from dev in connection spawning - Added environment variable support (.envs) to subprocess spawning - Merged documentation for both features in tui/docs.md Both features are independent and now work together: - Trace config enables debugging of ACP JSON-RPC traffic - History persistence enables message history storage and navigation 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <contact@tilework.tech>
0dc3e3e to
cb18831
Compare
Make ACP traffic tracing available only in debug builds to prevent accidental exposure of traffic logs in production while maintaining zero runtime overhead. Implementation uses a boundary-only approach with conditional compilation guards at exactly two points: - CLI flag visibility (--acp-trace only exists in debug builds) - Command spawn (build_agent_command ignores trace config in release) Config fields flow through all intermediate code unchanged, keeping the implementation simple while ensuring security. 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <contact@tilework.tech>
Collaborator
Author
|
Going to implement this much more cleanly later on, with |
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
🤖 Generated with Nori
sacp-teeproxy--acp-traceCLI flag oracp.trace_enabled = truein config.toml{codex_home}/log/acp-trace-{timestamp}-{pid}.logTest Plan
sacp-teeinstalled and--acp-traceflagFiles Changed
acp/src/connection.rs- AcpTraceConfig struct and build_agent_command()acp/src/backend.rs- trace_config field in AcpBackendConfigcore/src/config/mod.rs- acp_trace_enabled in Config, ConfigOverridestui/src/cli.rs- --acp-trace CLI flagtui/src/chatwidget/agent.rs- trace config constructionacp/tests/acp_trace_test.rs- new test fileShare Nori with your team: https://www.npmjs.com/package/nori-ai