Skip to content

Harden DCP chat transforms and clarify compacted output#510

Open
gmnstr wants to merge 3 commits intoOpencode-DCP:devfrom
gmnstr:pr/dcp-hardening-upstream-dev
Open

Harden DCP chat transforms and clarify compacted output#510
gmnstr wants to merge 3 commits intoOpencode-DCP:devfrom
gmnstr:pr/dcp-hardening-upstream-dev

Conversation

@gmnstr
Copy link
Copy Markdown

@gmnstr gmnstr commented May 7, 2026

Summary

  • clarify compacted tool output text so users can tell DCP compaction is local session handling rather than a provider-side failure
  • make chat message transforms fail open so DCP edge-case errors log and continue instead of aborting the active session
  • stop invalid message-ref assignment on alias exhaustion and add targeted regression coverage for the exhausted-capacity path

Verification

  • ran npm test
  • QA gate verdict: PASS
  • verified cherry-pickability onto current upstream/dev with no conflicts

Notes

  • branch contains three focused commits: placeholder clarity, runtime hardening, and the follow-up QA fix for message-ref exhaustion bookkeeping

gmnstr added 3 commits May 7, 2026 05:09
Replace the opaque '[Old tool result content cleared]' placeholder with
'[Tool output compacted locally; original in session storage.]' to make
it clear that compaction is a local optimization, not a provider failure.

This reduces confusion when users see compacted output in their sessions.
Apply three defensive patches from 2026-04-16 session hardening:

1. hooks.ts: Wrap createChatMessageTransformHandler body in try/catch so
   any DCP transform failure degrades safely instead of aborting the session.

2. message-ids.ts: Replace hard-throw on alias exhaustion with graceful
   degradation (return empty string). This prevents session crashes when
   message volume exceeds the referenceable range.

3. token-utils.ts: (already committed) Improve compacted tool output placeholder
   message for clarity.

These are fail-open defensive changes that reduce ghost/hard-stop behavior
when DCP encounters edge cases.
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