feat(omo-opencode): render background task notifications as markdown - #7042
feat(omo-opencode): render background task notifications as markdown#7042Zaldaryon wants to merge 1 commit into
Conversation
Parent wake notifications are written in markdown, and a client that renders only assistant output prints them verbatim. The person watching the session reads the raw system-reminder block, headings, bold markers and all. createRenderedInternalAgentTextPart tags the notification part with metadata.render set to "markdown" so a client can render it. Clients that do not read the hint keep their current behavior, and nothing changes for the model, which still receives the same text.
|
All contributors have signed the CLA. Thank you! ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
1 similar comment
|
I have read the CLA Document and I hereby sign the CLA |
|
Root suite result, as promised in the PR body. On this branch: 15735 pass, 43 skip, 9 fail across 15787 tests in 2064 files. Nine failures sounded bad, so I ran the same suite on the parent commit and diffed the failing test names. The base has 10 failures. Every failure on this branch also fails on the base, and no test fails only here: The eight shared failures, deduplicated: Four are shell detection asserting Windows behavior, two check packaging artifacts that a fork checkout does not carry, and two are assertions on local state. My environment is WSL2 on Linux with Bun 1.3.14, so I read all eight as environment rather than as anything this branch touches. Say the word if any of them is meant to pass on Linux and I will look closer. The tenth failure, |
Summary
<system-reminder>block,**ID:**, backticks and all, sitting next to assistant text that is rendered.metadata.renderset to"markdown", which lets a client render it. Clients that ignore the hint behave exactly as they do today, and the model receives the same text either way.Changes
packages/utils/src/internal-initiator-marker.ts: addscreateRenderedInternalAgentTextPart, which iscreateInternalAgentTextPartplusmetadata: { render: "markdown" }. The existing helper is untouched, so task prompts sent to child sessions keep their current shape.packages/omo-opencode/src/features/background-agent/parent-wake-prompt-dispatch.ts:sendParentWakePromptbuilds the notification part with the new helper on both the reply and the no-reply path.withInternalNoReplyMarker, and for the part thatParentWakeNotifieractually dispatches.Why the hint and not
synthetic: true: synthetic hides the part, which is right for text meant only for the model. A completion notice is also for the person watching, so it needs to stay visible and be readable.QA & Evidence
What was tested:
bun run typecheckObserved result: exit 0, no diagnostics
Artifact: console output
Why sufficient: covers the new export and both call sites across every workspace project
What was tested:
bun run buildObserved result:
build: all steps completed, exit 0Artifact: console output
Why sufficient: the generated bundles rebuild cleanly with the change; regenerated dist files are deliberately left out of this PR
What was tested:
bun test packages/omo-opencode/src/shared/internal-initiator-marker.test.ts packages/omo-opencode/src/features/background-agent/parent-wake-notification-render-hint.test.tsObserved result: 27 pass, 0 fail, 54 expect() calls
Artifact: console output
Why sufficient: the five new cases pin the hint on the helper, through the no-reply marker, and on the part
ParentWakeNotifierdispatches, next to the existing marker cases that guard the untouched helperWhat was tested: the root
bun testsuite, on this branch and on the parent commitObserved result: 15735 pass, 43 skip, 9 fail here against 15729 pass, 43 skip, 10 fail on the base. No test fails only on this branch
Artifact: the failing test names and the diff are in a comment on this PR
Why sufficient: it separates pre-existing environment failures from anything this change could have caused
Risks & Residuals
metadatarenders the notification exactly as it does now. Mitigated: the hint is additive and nothing branches on it inside this repo.createInternalAgentContinuationTextPartsets its ownmetadatafor compaction. Not applicable: it builds on the untouched base helper and is synthetic, so it is hidden regardless.Automated Checks
bun run typecheck bun run build bun testRelated Issues
Reader side of the same problem: anomalyco/opencode#43319 and anomalyco/opencode#43318.