Skip to content

feat(gasp): record plugin logs on their run (opt-in) - #269

Merged
yuanhao merged 2 commits into
mainfrom
feat/gasp-plugin-logs
Oct 9, 2026
Merged

yuanhao merged 2 commits into
mainfrom
feat/gasp-plugin-logs

Conversation

@yuanhao

@yuanhao yuanhao commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

A rutis plugin's diagnostics (the yoagent-rutis bridge's log, #268) can now be part of a GASP run's record — a plugin's "your policy did not apply" belongs in the audit trail next to the tool calls it affected.

Opt-in, two pieces from the recorder:

  • recorder.extension() — install on the agent; at each run's start it learns yoagent's run id (GASP generates its own run id and AgentStart carries none, so this is the link).
  • recorder.plugin_log_layer() — add to the tracing subscriber; it forwards events of target yoagent_rutis::plugin (gasp::PLUGIN_LOG_TARGET) whose run_id is one of this recorder's runs.

The recorder writes each line as observation.created linked to the run (record_observation; failure.observed has no run link), through the summarizer like tool output (so redaction applies), with {source: "plugin", level} metadata. Lines arriving before AgentStart are buffered; queued lines are drained at the stream's end. Another agent's lines, or lines without a run, are never recorded.

gasp now also enables optional tracing-subscriber (registry only). Zero loop changes.

Test tests/gasp_plugin_log_test.rs (own binary, global subscriber): a stand-in plugin logs its run's line, another run's line and a run-less line; exactly the first is recorded, on the right run. Mutation-checked (no run link → fails; no run filter → fails). cargo test --all-features, clippy (all / no-default / gasp-only), docs -Dwarnings pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG

yuanhao and others added 2 commits October 8, 2026 23:46
GaspRecorder::extension() learns each run's yoagent run id;
GaspRecorder::plugin_log_layer() forwards tracing events of target
yoagent_rutis::plugin (the bridge's log) whose run_id is one of the
recorder's runs; the recorder writes each as observation.created on the
GASP run, through the summarizer, with {source: plugin, level}. Lines of
other runs or none are never recorded. The gasp feature enables optional
tracing-subscriber (registry). Test: tests/gasp_plugin_log_test.rs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
…s plugin logs

Review: consume cleared the route unconditionally at its end, so a
recording opened before the previous handle finished lost all its plugin
log lines silently. The route is now cleared only while it is still the
recording's own (same_channel). Lines queued when AgentEnd arrives are
recorded before it, inside the run. Docs: tracing-subscriber 0.3 is the
host's dependency; record every run of an agent with the extension.
Test: two recordings back to back, the first held open while the second
starts (fails without the fix).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
@yuanhao
yuanhao merged commit 8f83aa1 into main Oct 9, 2026
15 checks passed
@yuanhao
yuanhao deleted the feat/gasp-plugin-logs branch October 9, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant