fix(opencode): clone part data in Bus event to preserve token values by ryanskidmore · Pull Request #15780 · anomalyco/opencode
bot
added
the
needs:compliance
label
Mar 3, 2026The 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.
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