Skip to content

fix(qq): preserve accepted work across controlled provider updates - #38

Open
Entropy-Enthalpy wants to merge 1 commit into
BotHarness:mainfrom
Entropy-Enthalpy:fix/qq-durable-consumer
Open

Entropy-Enthalpy wants to merge 1 commit into
BotHarness:mainfrom
Entropy-Enthalpy:fix/qq-durable-consumer

Conversation

@Entropy-Enthalpy

Copy link
Copy Markdown

Restarting the QQ Provider currently loses the source eligibility needed to reply to accepted work, while the native reply sequence and attempted budget remain process-local. Stopping the receiver also revokes its consumer lease before an in-flight acceptance can finish.

This change keeps compact source proofs and reply attempts in the existing QQ state owner. It writes the proof before acceptance, reserves each native sequence before sending, retains an uncertain send's spent budget across restart, and releases completed sources without resetting an active native reply budget. Controlled shutdown drains callbacks and canonical acceptance before saving the SDK's session/cursor and withdrawing the consumer lease. Reopening verifies the same account and waits for the new exclusive consumer before receiving.

The existing same-Host service gains optional quiesceInbound, resumeInbound, and releaseSource operations, documented in docs/qq-consumer-continuity.md. Native reply windows, media eligibility and receipt shapes remain intact. No SDK source, package identity, dependency version or update policy changes are included.

Validation on Node 24.15.0 / Linux:

  • Three focused regressions fail on unchanged main for lost source state, admission after a failed proof write, and missing persisted attempt state.
  • The affected QQ persistence, controlled-update, ordinary-text and media regressions pass. The native SDK uses loopback HTTP/WebSocket endpoints and real temporary filesystem state, including an uncertain POST, resumed source reply, write/sync failures, and more than 2,000 later messages.
  • Public service/Host, shared startup and delivery-adapter regressions pass, including actual Cordis dependency disposal and source release through the public service.
  • Original Host build, complete Host import and git diff --check pass.

Windows retains file flushing and atomic replacement. Node cannot fsync directories on Windows, so directory synchronization and its two syscall-failure tests are POSIX-specific. The existing Windows CI job now includes the QQ file/restart/update regressions; local Windows execution remains unverified.

A saved cursor supports a controlled update when the platform accepts resume. Platform replay retention, abrupt termination, power-loss guarantees and live QQ acceptance are outside this verification.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14a4c076-e9c9-4b31-844d-a9c7090bdd15
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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