Skip to content

Bug: explicit empty remote streaming completion appends fallback diagnostic history #1769

Open

Description

@JoshuaRowePhantom

Summary

An explicit empty StreamingCompletedEvent.Items is treated as if the optional list were absent. Completing a real owner running item after its messages were promoted and cleared appends a synthetic empty diagnostic to remote history even though the authoritative owner adds nothing. This is a source-proven local/remote parity defect present in immutable HEAD f3a560c1efb58f1c86c068e3a3dabcf48ac2d56b, distinct from #1763's duplicate history-appended publication. Observed during #1763; failure tracking remains #1768. No implementation or execution is performed by this diagnosis.

Root Cause

Immutable sources:

This is not a request to filter diagnostic messages, deduplicate equal values, or change SDK behavior. Legitimate single-item legacy and diagnostic completions must still append their actual item.

Evidence binding and limits

Original host de30e4af-2d0e-4604-b123-7240a1d2760f, DAEMON, original jrowe_DAEMON_2026-11-19_01_31_43_net10.0.trx under C:\dev\Phantom.Workspaces-Skills\worktrees\r1768-f1\original-artifacts; SHA256 A565536A475F62CC2D05DB4BFCE68D14D9D7C3742D9509E64C2DFA55B104FCC8 (66435 bytes). Overall FAILED, 15 executed /8 passed /7 failed. Three non-reconnect scenario executions (6fe842a6-60bd-4d55-aa21-da275ba5f30a attach, 3de6c1c6-601f-48aa-bdec-01e8b8aaf8b3 running, dba54b1f-dd70-4bc3-9a24-c48f09765433 history) fail at current ScenarioTests.cs:134, caller91, AFTER first synchronization/history/running assertions and owner clear/completion plus second synchronization. Raw xUnit mismatch: expected array ends at position878; actual continues },\r\n {\r\n "role": "diag".... Raw does NOT retain the full actual item/history or the completion frame, so the exact full incident payload is not claimed recovered. Source supplies the empty-list/fallback mechanism and predicts the extra diagnostic; no byte-for-byte incident frame reconstruction is asserted.

Independently checked archived PE/portable-PDB CodeView identities, PDB document hashes against live and archived tested source, and all335 archived/original DLL/PDB copies. Core image SHA256 F22C596055812BBA5C8C201DF7DD83D731E5EBF78C6E98FF743A0A486FA73FC9; current Core source equals HEAD. Provenance detail is permanently recorded on #1768. No new test invocation, capture, or source modification.

Duplicate review: exact StreamingCompletedEvent/empty-completion searches; #570 is an owner provider-error assistant-placeholder bug, #1736 is missing durable provider output, #1763 is sender snapshot/HistoryAppended ownership. None is this null-versus-empty completion mechanism.

Affected Files

File Contribution
Phantom.Workspaces.Llm.Core\Remote\RemoteAgentChat.cs Empty/absent list conflation and completion history projection
Phantom.Workspaces.Llm.Core\Remote\AgentSessionProtocol.cs Optional nullable completion list compatibility contract
Phantom.Workspaces\Services\AgentSessions\RemoteAgentSessionLease.cs Explicit empty list plus legacy fallback producer; preserve its complete list
Phantom.Workspaces.Llm.Core.Tests\RemoteAgentChatTests.cs Focused proxy compatibility/occurrence regression
Phantom.Workspaces.Tests\Scenarios\RemoteAgentSessionScenarioTests.cs Real owner/lease/channel/proxy composition

Design / Fix

Preserve the distinction: use the explicit list whenever non-null, including empty; only a genuinely absent/null legacy list falls back to [e.Item] (e.g. e.Items ?? [e.Item]). Retain wire validation, exact occurrence/order semantics, completion run retirement and TurnCompleted behavior. Do not ignore diagnostics, compare by value/run ID, suppress arbitrary frames, or weaken scenario assertions. Coordinate with #1763 without conflating mechanisms. This is a proposed bounded source repair, not an authorization to implement or qualification of current WIP.

Expected Tests

Test Name Class What It Verifies
StreamingCompleted_ExplicitEmptyItems_RetiresRunWithoutAppendingHistory RemoteAgentChatTests Real codec frame with explicit empty Items removes running state and emits no History/TurnCompleted occurrence, regardless of fallback Item role.
StreamingCompleted_AbsentItems_AppendsLegacyItem RemoteAgentChatTests Null/absent legacy Items still appends exactly the Item, including legitimate diagnostics.
StreamingCompleted_RepeatedAndEqualItems_PreservesOrderedOccurrences RemoteAgentChatTests Nonempty complete list, repeated positions and value-equal distinct entries survive serialization in exact order.
HistoryPromotion_SnapshotThenRelease_PreservesOrderedOccurrencesAcrossViewers RemoteAgentSessionScenarioTests All six existing rows retain full owner/first/joining ordered history assertions, snapshots, CAS barriers, reconnect and cleanup; unrelated blockers remain separately tracked.

No green claim; no waiver of #1768 or older failures.

Activity

  1. added
    bug
    diagnosed
    on Nov 19, 2026
  2. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Design — coupled bounded repair

    Preserve #1763 worker-owned publication positions per replacement generation (not reference/value dedup), capture-only versus serialized snapshot ownership, and exact ordered repeated occurrences. Repair #1769 by honoring every non-null completion Items list, including empty; only null/absent uses legacy Item, retaining real diagnostics. Repair #1770 by returning the newly allocated retention frame exactly once after the covered replay cut, keeping ordinary client gap rejection, staged activation, receipts and generation fencing. Correct #1768 fixtures by blocking the admitted attach publication, not earlier Busy work, retaining 0/2 assertions; distinguish covered replay SAME identity from deliberately evicted cursor/snapshot NEW identity. Add deterministic codec/proxy and lease/real-channel regressions and execute only changed/related managed methods through the existing approved runner. No owner-UNKNOWN case, native, full, stability, qualification or incident-cause claim. Original r1768-f1 and r1763-e9 remain FAILED; source proofs do not establish original reconnect timeout cause. Files: lease, RemoteAgentChat, focused Core tests, RemoteHistoryOwnerTests, scenario tests. Shared source ownership requires coherent coupling; logical issue commits will follow only healthy targeted results.

  3. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Implementation attempt STOPPED — new red #1771; no green/commit claim

    Known coupled source/fixture repairs are implemented but UNCOMMITTED and NOT qualified. HEAD remains f3a560c1efb58f1c86c068e3a3dabcf48ac2d56b. Required immediate stop was honored on the FIRST targeted managed Core run: host 265087da-81c8-4bf2-8ff2-c7887fe2b15d,14 executed/12passed/2failed, overall FAILED. Two absent-list theory rows fail at the new fixture assertion RemoteAgentChatCompletionTests.cs:63 before completion application. Full new-red evidence and parent-routed isolated diagnosis requirement: #1771. No diagnosis guessed; no edits/builds/tests/retry after red, no Main/native/full/stability execution, no commits/push/closure.

    Implemented pending verification: #1763 worker-owned per-position snapshot/publication ownership (incoming WIP retained); #1769 non-null Items, including empty, authoritative (legacy null only fallback); #1770 covered replay explicitly returns newly allocated retention frame exactly once after replay cut, preserving write receipts/staging and real-gap rejection. Fixture corrections retain0/2 queued-attach assertions while blocking admitted-attach-generated work, distinguish covered-replay SAME identity from deliberately evicted cursor/snapshot NEW identity, and retain exact repeated-reference/equal-value ordered histories plus later generation/disposal checks. New host regression accounts for complete replay,retention,next sequence,staged activation,other-viewer receipt and stale-generation disposal. These Main/scenario assertions are source present, not executed in this attempt.

    Necessary Main/Core builds ultimately succeeded0warnings/0errors; pre-test compile correction attempts are retained, not hidden. Core passing rows reached explicit-empty/null/nonempty+real-diagnostic compatibility and existing streaming/marked-reset/stale-reset/different-epoch/real-gap rejection; absent rows did NOT reach final compatibility assertions. No passing-count failed-host waiver.

    Evidence COPY-ONLY root C:\dev\Phantom.Workspaces-Skills\worktrees\r1770-g2: immutable incoming WIP/index/base and exact correction deltas; entire final tracked source+new test ZIP;1042 copied output files and hashes; six relevant PE/PDB identities all match,2090 physical PDB source document hashes match,108nonphysical/generated entries explicitly unverified; original TRX SHA256 7ED366B580BD3D541DE2F5DBB86E4F4B63B9BAB2DC5FAD47A5113161C9ACA93E; original summary/counters/all result records,definitions,entries,ErrorInfo,RunInfos and command/time/log receipts. Host abnormal counters all0; two error failure notices,two warnings(discovery and Blame-finished/no-sequence),no new dumps/sequence/attachments. Historical result audit zero mutations; original default log absence preserved in finally; index unchanged.

    #1768 overall NOT resolved: original owner NONOBJECTFRAME remains separately UNKNOWN; original three reconnect timeout causes not proved by #1770 source mechanism; r1768-f1 and r1763-e9 remain FAILED/immutable. #1754/#1517/#1175 unknown/unwaived; #1722 unresolved/excluded. Performance #1702/#1703 has no qualification claim. Parent must route isolated diagnosis before resuming; remaining #1764/#1765/#1766/#1756 scopes untouched.

  4. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Read-only isolated #1771 diagnosis: #1771 (comment)

    The new absent-list rows are RELATED to their fixture construction, not evidence that the production null/empty repair failed. Raw Core remains 14 executed /12 passed /2 FAILED. Both stop at completion-test line63, before completion send66 or history/TurnCompleted checks72-75: typed null Items already serializes as an absent member, so JsonObject.Remove returns false. The passing rows named null use the same omitted shape and do not establish explicit-wire-null coverage. Actual DLL/CodeView/PDB/document hashes bind the examined tested-source-final ZIP entries to compiled source; earlier tested-source.zip differs in two compiled documents. See linked evidence, contract matrix, Expected Tests and coherent absent+explicit-null fixture repair proposal; no repair or execution performed. Preserve explicit-empty authority, legitimate diagnostic legacy fallback and exact ordered occurrences. No issue closure/label/body change or green claim.

  5. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Design — bounded coupled completion after isolated #1771 diagnosis

    Correct the fixture, not protocol serialization: assert absent Items is absent; construct explicit present JSON null and check its actual kind before send. Preserve all eight role/list rows, independently expected full histories, duplicate occurrences, run retirement and TurnCompleted ordering. Add independently authored codec shapes. Carry forward #1763 worker-owned per-position snapshot/publication ownership and replacement-generation reset, #1769 every non-null list including empty, #1770 returning the retention publication once after the replay cut, plus admitted-attach blocking and replay SAME versus forced-gap NEW running identity fixtures. Only selected managed Core/Main contracts through existing runner; UNKNOWN owner case excluded. No causal claim for original reconnect timeouts or overall #1768 resolution. Original r1770-g2 Core14/12/2 and older reds remain immutable. No native/full/stability/qualification/push/closure. Evidence: worktrees\r1771-h3; exact source baseline is prior tested-source-final.zip, never earlier tested-source.zip.

  6. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Coupled repair STOPPED — new Core red on #1771

    Evidence and mandatory parent-routed isolated diagnosis: #1771 (comment)

    First selected managed Core invocation:23 executed/17passed/6failed, overall FAILED. Exact raw failures, host counters/RunInfos, original TRX hash and source/PDB provenance linked. No edits/retry/Main/native/commits/push after red. No issue completion or qualification. Original owner NONOBJECTFRAME and original reconnect attribution remain separately UNKNOWN; other four scopes untouched. Evidence worktrees\r1771-h3; HEAD f3a560c1efb58f1c86c068e3a3dabcf48ac2d56b; owned WIP retained; candidate ownership released for parent routing.

  7. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    NEW #1771 occurrence — bounded read-only diagnosis, not production qualification

    Independent evidence/compiled-source binding, six exact cases, observed-vs-unreached assertions, JSON contract audit and proposed Expected Tests: #1771 (comment)

    Original r1771-h3 Core run remains FAILED:23 executed/17 passed/6 failed, no crash/timeout/dump/sequence evidence. Four new codec rows fail a compact literal vs indented Item at codec-tests49 (the complete retained Items are semantically identical); two nonempty diagnostic False/True rows fail root-array vs nested-wire-array text at completion-tests75, before completion send77. Their complete arrays are not retained, so full nonempty payload/application correctness remains UNKNOWN. These are RELATED fixture/oracle defects, not a proven new production defect or cause for older failures.

    Six empty/null/absent remote rows did pass the retained whole-history/completion checks, including now-genuine explicit-null wire coverage. This does not waive the six reds or establish nonempty completion postconditions. Preserve #1769's authoritative [] versus absent/null legacy fallback distinction, full properties/order/repeated/equal occurrences and legitimate diagnostics. Proposed repair is independent complete semantic JSON assertions, not serializer-option changes, count-only comparison, normalization, role filtering or deduplication. No implementation/execution authorization; Main/remaining repairs not run; stopped source and released execution ownership unchanged.

  8. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Design — bounded coupled completion (r1771-i4)

    Implementing independently authored complete structural JSON oracles (framework JsonElement.DeepEquals, full expected/actual failure output), keeping absent versus explicit-null versus empty versus nonempty wire assertions and every ordered repeated occurrence. No production serializer/options change is justified by #1771's oracle reds.

    Preserving the pending #1763 publication-worker occurrence-position ownership repair: published snapshots own included positions, capture-only snapshots do not; history replacement resets ownership. Preserve repeated references/equal values. #1769 selects every non-null list including []; null/absent alone selects legacy Item, including legitimate diagnostics. #1770 returns the retention frame allocated after the replay cut exactly once in initial frames, preserving staged activation, receipts, other viewers and generation cleanup. Coupled Main fixtures distinguish covered replay identity from forced-gap replacement identity and block work generated by the admitted attach, not earlier Capacity work.

    Only necessary no-restore builds and approved changed/related managed method selections, excluding the UNKNOWN owner NONOBJECTFRAME case; stop on any new red. Historical failures/nohit remain immutable. No original owner/reconnect causality, overall #1768 resolution, native/full/stability/qualification, integration/push or closure claim. Scope excludes #1764/#1765/#1766/#1756.

  9. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    NEW r1771-i4 occurrence stopped: Core50 executed/49 passed/1 failed; details, original TRX/hash/full host health and required parent-routed isolated diagnosis: #1771 (comment) . No further edits/build/tests/commits; Main and remaining repairs unexecuted. Independent complete JSON oracles reached the prior codec/nonempty completion checks successfully in their passing cases, but no overall green/qualification claim. Original owner NONOBJECTFRAME and original reconnect attribution remain UNKNOWN; frozen NOHIT is not a waiver. Candidate HEAD unchanged f3a560c1efb58f1c86c068e3a3dabcf48ac2d56b; WIP/evidence/index/default log protected. Coupled #1763/#1768/#1769/#1770 and performance #1702/#1703 remain incomplete. Execution ownership released; parent must route diagnosis before any continuation.

  10. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Independent NEW read-only diagnosis of the r1771-i4 04:15 original host is persistent: #1771 (comment) . RELATED fixture exception-boundary error, not evidence against #1769's explicit-list semantics: blank RunId fails typed codec Validate/RequireText with ArgumentException (ParamName RunId) before PrepareFrame's Items selection; this row did NOT call SerializeFrame or reach transport/application. Existing empty-required-ID codec contract and actual archived IL/PDB corroborate the identity. Original host remains FAILED 50 executed/49 passed/1 failed; raw SHA256 601BCD3AD6C3975A2B2D4C276E62E5E1CA841793CE5ADF0818CA4A52EBC27051. Full raw case/host/bit provenance, all six negative-row audits, narrow fixture repair requirements and strict independently authored invalid-wire/state-mutation Expected Tests are in the linked diagnosis. No implementation, rerun, qualification, source/index/evidence write, labels/body/open-state change or ownership acquisition; implementation remains paused. Do not waive required members/nonblank/unknown-run/selected-payload checks or alter production contracts merely to satisfy the incorrect grouping.

  11. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Design — authorized narrow coupled repair

    Implementing #1771's independently diagnosed test-only exception-domain correction: exact ArgumentException/RunId at PrepareFrame's typed validation; selected-null history retains exact protocol errors, shapes/missing required members retain JsonException. Add distinct actual ingress/no-mutation, unknown-run application/cleanup-error identity, unused fallback, and outbound pre-write guards; preserve complete structural JSON oracles and negative controls. No production validation changes.

    Preserve/complete incoming #1763 position/generation publication ownership, #1769 nonnull-list authority including [], #1770 returning the new retention frame after covered replay. Keep the admitted-attach fixture's original 0/2 assertion and replay Same versus forced-gap snapshot NotSame. Approved existing runner only: combined changed Core selectors, then known Main selectors excluding UNKNOWN owner. No native/full/stability/capture/retries. Any new red stops implementation for parent-routed isolated diagnosis.

    Baseline f3a560c1efb58f1c86c068e3a3dabcf48ac2d56b, five modified tracked/two untracked files, empty index. Incoming preimages/index and further evidence retained at C:\dev\Phantom.Workspaces-Skills\worktrees\r1771-j5. Prior reds immutable. #1768 owner NONOBJECTFRAME and original reconnect timeout cause remain UNKNOWN; #1754/#1517/#1175 unwaived. No push/integration/closure or other-four-scope edits.

  12. JoshuaRowePhantom commented on Nov 19, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Implementation receipt — known coupled scope only (not batch qualification)

    Candidate C:\dev\Phantom.Workspaces-Skills\worktrees\pf1117-1545, branch batch/1702-1703-startup-first-1117; baseline f3a560c1efb58f1c86c068e3a3dabcf48ac2d56b -> clean HEAD 24a47202ea704cba47872a042680fe665d53af51. Incoming five modified tracked/two untracked files and exact original index were archived before edits; unrelated four scopes #1764/#1765/#1766/#1756 untouched. No push/integration/closure.

    Logical commits:

    Validation: existing approved runner, one combined Core invocation then one known Main invocation, explicit projects/selectors, -NoBuild -Mode fast, external result paths. Core 72 executed/72 passed/0 failed; Main 17/17/0. Both raw ResultSummary Completed; results/definitions/entries exactly72 and17 respectively; every other counter0, no ErrorInfo or Error RunInfos, no attachments/new dumps/sequence. Core has2 Warning RunInfos (unrelated nonserializable discovery-data warning; completed Blame/no sequence); Main1 (completed Blame/no sequence). Discovery counts are NOT executed counts. Default candidate test-results.log stayed absent before/after/finally both calls. No retry/full/stability/native/qualification/capture.

    Raw authorities copied without rewriting:

    • Core jrowe_DAEMON_2026-11-19_04_36_42_net10.0.trx,123031bytes,SHA256 229821028FC912E1C5347F3EC2E549E16DFB2C4CBE1BEB5AF6FC923189AB4B0C,UTCticks639306886029714878.
    • Main jrowe_DAEMON_2026-11-19_04_39_01_net10.0.trx,29894bytes,SHA256 0D3AFA460FB06078076F7E8316A35ECC71F4B7D6633F303D5839B58E8ADDC11D,UTCticks639306887441564688.

    Evidence C:\dev\Phantom.Workspaces-Skills\worktrees\r1771-j5: baseline/index/incoming preimages and deltas, complete tested-source-final.zip, actual compiled DLL/PDB/dependency copies and hashes, exact commands/times/build logs, full original summaries/results/definitions/entries, case sets/artifact manifests and final committed-to-tested source match. Four actual PE/portable-PDB identities checked, nine scoped documents SHA256-matched to current and exact tested ZIP; this is bounded disk/source provenance, not runtime-module attestation. Necessary builds succeeded0warnings/0errors; first Core pre-test compile found unsupported xUnit2 TestContext usage, corrected before execution and retained both logs. All SDK calls process-local DOTNET_GENERATE_ASPNET_CERTIFICATE=false; no certificate/store access.

    Limits: original #1768 ordinary owner NONOBJECTFRAME remains BLOCKING UNKNOWN and was NOT selected. Original three reconnect timeout occurrence causes remain UNKNOWN; new #1770 continuity coverage does not recover their missing trace. All historical reds, including r1771-i4 50/49/1 and its authoritative tested-source-final.zip, remain immutable. #1754 OPEN UNKNOWN, #1517/#1175 causality unwaived; #1722 unresolved/excluded; #1735/#1738/#1739 repairs excluded; #1724 separate ReleaseInstall. Crossrefs #1702/#1703 do not claim performance/batch qualification. Parent owns fresh independent whole-batch review and remaining four scopes.

    Issue-specific assertions actually reached

    Explicit [] retires running state with no history or completion occurrence. Wire absent versus explicit-null presence/kind checked independently; only those legacy forms use Item. Nonempty lists preserve first,last,first,equal order and all cardinality. Real diagnostic role remains meaningful and unfiltered, and real owner post-release history parity reaches final assertions in Main. Full old incident diagnostic payload was not retained and is not claimed reconstructed.

    Files across coupled commits: AgentSessionProtocolCodecTests.cs; JsonPayloadAssert.cs; RemoteAgentChatCompletionTests.cs; RemoteAgentChat.cs; RemoteHistoryOwnerTests.cs; Scenarios\RemoteAgentSessionScenarioTests.cs; RemoteAgentSessionLease.cs. Diff:7files,+952/-18. All commits include exact Copilot coauthor trailer. No skills/state/SQL/tooling/active-features changes or cleanup. Source/build/execution ownership released to parent after this handoff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdiagnosed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions