Repository navigation
Description
What happens
ADR 0050 deferred pre/post script span instrumentation to implementation. It says pre-scripts, post-scripts and validation scripts "do significant work but aren't addressed in span structure", and leaves open whether the framework instruments them or gives scripts a contract to emit spans. Neither has been built yet.
- The run's span tree has the run, sandbox creation, each agent iteration and its tool calls. No script gets a span.
- From the scripts, the trace keeps whether the pre-script skipped the run, and why, and a pre-script or post-script failure becomes the run's error.
- Scripts get the run's trace context, but not the OTLP headers unless the harness declares them.
A post-script that exits 0 leaves no record of what it did. The code agent's post-script pushes the branch and opens the pull request, or posts "No PR created" and exits 0 when the agent made no changes. Scoring reads the run's run-telemetry.jsonl, so it can't tell those two runs apart. Triage on #9745 found the same, that no commit-count or PR attributes are emitted today.
What should happen
Each pre-script, post-script and validation script that runs gets a span in the run trace with its exit code. Scripts get a supported way to add records to it, for example the pull request a post-script opened or why it opened none. These records reach run-telemetry.jsonl and the OTLP export like the runner's own spans.
Records that can hold private text, such as an issue's text or a pull request body, are dropped from the published telemetry file at the metadata artifact level, as the pre-script skip reason already is.
Related
- #9745 asks
trace_fitnessto score what a run delivered, and its triage notes the PR information may only come from the post-script. This issue is the general way for a script to add that kind of record. - #7413 proposes a
post-outcome.jsonthat post-scripts write to report what they did. That could be one source for these records. - ADR 0165 (open PR #9264) has the journal called from pre/post scripts. Those calls could add their records the same way. This issue doesn't depend on it.
- #9060 (ADR 0154) and #6433 are about joining related runs. This issue is about what one run's trace contains.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
fullsend-ai-triage commentedon Nov 20, 2026
🤖 Finished Triage · ✅ Success · Started 2:59 PM UTC · Completed 3:01 PM UTC
Commit:
227f3cb· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.16
fullsend-ai-triage commentedon Nov 20, 2026
Triage found this actionable as a feature request. It is the pre/post/validation-script item that ADR 0050 explicitly deferred to implementation. The code locations the issue points to still exist: script handling in
internal/cli/run.go, the span and export code ininternal/telemetry/, and the metadata-level stripping ininternal/artifacts/telemetry.go.Related work (checked): no open PR addresses this issue. #9745 (trace_fitness deliverables) would consume these records. #7413 (
post-outcome.json) and ADR 0165 (PR #9264) are possible sources for records, but they are not prerequisites, as the issue says.Open design point for maintainers (not the reporter): the exact contract for scripts to emit records (a file or env-var channel the runner reads after the script exits, or reuse of #7413's artifact) is not settled in the repo. It should be decided in the implementation or a short ADR update. Records from scripts are untrusted input, so the contract should cap their size and count and tag which keys are private text so
StripTelemetrycan drop them.Suggested test:
This is a feature, so it is not auto-promoted to code and will wait for human prioritization.
Labels: This is a new-capability request in the agent runner's tracing and telemetry behavior.
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidance