Skip to content

Handoff sidecar reader: canon says a non-integral pid is refused, the code admits it #353

Open

Description

@Blind-Striker

Canon and code disagree on how the persistent-terminal handoff sidecar reader treats a pid that is not an integer.

  • Canon: docs/architecture/client-runtime.md (Background service, "Stricter readers than upstream's JSON.parse") says "The sidecar reader refuses a pid that is not integral. A refused document reads as absent."
  • Code: src/OpenCode.Sdk/Hosting/BackgroundService/Internal/Handoff/PtyHandoffSidecar.cs (around lines 149-160) admits such a document with SourcePid = null.
  • Tests require the code's behaviour: tests/OpenCode.Sdk.Tests/Hosting/BackgroundService/Handoff/PtyHandoffSidecarTests.cs (around lines 59-85) expects admission, and ServicePtyHandoffTests.cs (around lines 246-254) expects adoption without a readable registration.

One of the two is wrong. Under the deviation protocol, this needs a decision on which behaviour is intended, checked against upstream's pinned packages/client/src/pty-handoff.ts, before either side changes.

Found by the Faz 4 RT-E1 implementation plan (2026-10-16), at origin/master eef754bd. RT-E1's U4-15 fix (whole-document reads) does not touch this behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions