fix(opencode): clone part data in Bus event to preserve token values by ryanskidmore · Pull Request #15780 · anomalyco/opencode

@github-actions bot added the needs:compliance

This means the issue will auto-close after 2 hours.

label

Mar 3, 2026

@ryanskidmore

The PartUpdated Bus event was passing the original part object reference, which could be mutated by Zod parse before subscribers received it. Using structuredClone ensures JSONL step_finish events contain the correct non-zero token values. Includes regression test.

Grappeggia pushed a commit to teamslop/slopcode that referenced this pull request

Mar 4, 2026

@ryanskidmore @Grappeggia