Skip to content

fix(release): restore the native release baseline checks - #192

Merged
nullStack65 merged 1 commit into
release/native-0.1.10from
fix/native-release-typecheck-and-question-wake
Nov 23, 2026
Merged

nullStack65 merged 1 commit into
release/native-0.1.10from
fix/native-release-typecheck-and-question-wake

Conversation

@nullStack65

Copy link
Copy Markdown
Owner

Problem

Four failures on release/native-0.1.10 at 8fc8cb5ae264962d18851827e14f9596f8ffc291 blocked the native release baseline.

Change

Verification

  • On pristine 8fc8cb5a, reproduced TS377042 and the stale-question wake failure twice, the fresh scheduled-delivery failure three consecutive times, and Knip's unused-export report.
  • On checksum-verified Node 26.13.1, the original wake and scheduled-delivery assertions pass. The related orchestration suites cover removed and disabled provider holds, recovery, and delegated completion delivery.
  • Web, desktop, server, and contracts typechecks passed. vp run check:changed 8fc8cb5ae264962d18851827e14f9596f8ffc291 passed, and the normal push hook accepted the branch. The branch contains one commit.

Tracked in CLO-694. Original handoff in CLO-910.

Deploy: none

Implemented with codex/gpt-6.2-sol in the T3 Codex harness.

Use the Effect Schema predicate for private-note errors. Promote queued wakes on enabled built-in providers and reserve a distinct provider thread for queued fresh sessions. Keep the file-local botSeat helper private.

Model: codex/gpt-6.2-sol
Task: bugfix
Agent: Codex
Lane: codex
Harness: t3
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

  • Trigger review

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

Run configuration

  • 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

@nullStack65

Copy link
Copy Markdown
Owner Author

Independent fast review: the native release baseline fix (PR #192)

Head reviewed: e1aaf0ae25bc1ae5721e6f30a26f1a0a4daca16b (one commit on release/native-0.1.10 at 8fc8cb5a). 3 files, +10/−5. Read-only review. Nothing was pushed or merged.

Checked:

  1. Queue promotion gate (Orchestrator.ts ~2721). A queued run on a built-in instance with no settings row (codex, claudeAgent) now resolves as enabled through isUnconfiguredDefaultInstanceEnabled, which matches resolveProjectProviderInstanceEnabled. A removed custom instance still holds, even with a project override of true. A project override of false and machine-level disabled instances still hold. Configured instances behave the same as before.
  2. Fresh-context enqueue (~7984). Before this change, a fresh-context message that queued behind active work reused the active provider thread. It now gets a new pending:<runId> row, and the existing targetProviderThread === undefined branch persists that row through provider-thread.updated. At promotion, the fresh path reuses the stored reserved row only when that row is still unused (firstRunOrdinal/nativeThreadRef null, same instance). Otherwise it mints pending:<run>:fresh. The two paths agree.
  3. Schema.is(HumanNoteUnavailableError). HumanNoteUnavailableError is a Schema.TaggedError class, so this check is valid and follows the existing Schema.is usage in apps/web.
  4. botSeat. It is only used inside botOrgTree.ts, so making it file-local is safe.
  5. Secrets and scope. The diff adds no credentials or tokens. Each change maps to one of the four failures listed in the PR body, with no unrelated edits. All CI checks are green (ARC CI ×4, deploy line, CodeRabbit).

Critical (0)

None.

Important (0)

None.

Minor (2)

  1. The promotion gate now has a rule of its own for an unconfigured non-built-in instance with project override true: it holds, while resolveProjectProviderInstanceEnabled would return enabled. This looks intentional (a removed custom instance can't run), but a one-line comment at the gate would stop someone from "simplifying" it back to the shared resolver later.
  2. The PR adds no new regression tests. It relies on the existing wake and scheduled-delivery assertions that had been failing. That is acceptable for a baseline repair, but a direct test for a fresh-context message queued behind an active run getting a distinct provider thread would protect the feat(server): deliver messages by class, never into a compaction #144 fix.

Verdict: 0 unresolved Critical/Important findings.

@nullStack65
nullStack65 merged commit c3729c6 into release/native-0.1.10 Nov 23, 2026
6 checks passed
@nullStack65
nullStack65 deleted the fix/native-release-typecheck-and-question-wake branch November 23, 2026 19:42
@nullStack65

Copy link
Copy Markdown
Owner Author

Independent bot review (Claude)

Reviewed head: e1aaf0ae25bc1ae5721e6f30a26f1a0a4daca16b, base release/native-0.1.10 at 8fc8cb5ae264962d18851827e14f9596f8ffc291. Read-only review. The PR merged during the review, so this is a post-merge record.

Verification (Node v26.13.1, checksum-verified download, scratch worktrees outside the main checkout)

  • Web typecheck (effect-tsgo tsrs --noEmit in apps/web): base fails with useComposerSend.ts(630,26): error TS377042 ... effect(instanceOfSchema). Head passes with exit 0.
  • Server tests on head: control-reads, SteeringCompletion, ProviderSwitch and ThreadStop. Totals: 203 passed, 12 failed, 215 total. Both control-reads ("drops a stale question wake") and SteeringCompletion pass. ThreadStop "Force stop keeps only the session of a queued follow-up that has fresh context" passes. ProviderSwitch "keeps the thread a queued fresh run reserved for that run" passes, and on base that same test logged an InterruptError in waitForIdle.
  • The 12 head failures: 11 queued provider-switch or account-switch tests in ProviderSwitch, plus ThreadStop "…that switched provider instance". Base also times out on at least one of them ("hands off interrupted context through the queue to a new provider via native history", 120 s timeout). The base run of the full set exceeded 25 minutes and couldn't finish, so I didn't confirm the other 11 on base. They all queue onto a custom instance id with no settings row (codex-other, codex-alternate, claude-second-account), which both the cause commit and this PR hold. So I attribute them to the baseline rather than to this PR. That attribution is inferred, not proven for all 12.

Findings

  1. important (non-blocking, predates this PR): the fix 2 branch misses project-enabled built-in defaults. For an instance with no machine row, the new branch holds unless the id is in DEFAULT_ENABLED_DEFAULT_INSTANCES (codex, claudeAgent). A project that enables a default-disabled built-in, such as cursor or grok, with no machine row is still held. deriveProviderInstanceConfigMap does hydrate that instance and force it enabled for the project, and resolveProjectProviderInstanceEnabled (used by the question path at Orchestrator.ts:11341, ThreadManagementService, placementEvidence and TextGeneration) returns true for it. A user-started send doesn't clear it either, because instanceDisabledForProject ignores userStarted, so the queue stays held. The fix 2 answer to "removed, disabled or held" is otherwise correct. A removed custom instance (no row, not a built-in default) stays held, even with a project override of true, which is right because hydration creates no adapter for it. projectOverride === false holds, and usage-limit holds are checked earlier. Suggested rule: hold when the id is neither a machine row nor a hydrated built-in default instance; otherwise use projectOverride ?? resolved machine/default enablement. Simplest form: check membership in deriveProviderInstanceConfigMap(settings), then call resolveProjectProviderInstanceEnabled.
  2. important (non-blocking, follow-up): 12 queued-switch tests still fail on the release line. These are the 12 listed under Verification. They share the gate from fix 2. The tests register adapters for custom instance ids that have no settings row, so the promotion gate holds the queue (expected [1] to deeply equal [1, 2], or a 120 s timeout). The test setup or the gate needs one consistent definition of an existing instance. Until one of them changes, "restore the native release baseline checks" is only partly true for the server suite.
  3. nit, test gap (d): no test covers the new machineInstance === undefined branch directly. Missing cases are an unconfigured codex with a project override of false (expect held) and an unconfigured project-enabled cursor (finding 1). Fix 4 is covered by the existing ProviderSwitch reserved-fresh-thread test and the ThreadStop fresh-context case. No tests were weakened; the PR touches no test files.
  4. nit, complexity (e): fix 2 re-derives the rule inline instead of reusing resolveProjectProviderInstanceEnabled plus an existence check. The duplicated logic is why the queue gate disagrees with the rest of the server. The other three fixes are minimal.

Per-fix assessment

  • Fix 1, useComposerSend.ts (cause 4201f4b): this is a real narrowing. HumanNoteUnavailableError is a Schema.TaggedError class, and Schema.is performs the same instance check instanceof did, as the instanceOfSchema diagnostic recommends. It doesn't hide a type mismatch.
  • Fix 2, Orchestrator.ts queue promotion (cause c21b68e): the change fixes the regression where an unconfigured codex or claudeAgent was always held. It doesn't let a removed, machine-disabled, project-disabled or usage-limited instance through. Gap noted in finding 1.
  • Fix 3, botOrgTree.ts (cause 8fc8cb5): making botSeat file-local is correct. It is only used inside the module.
  • Fix 4, Orchestrator.ts queued dispatch (cause 82c4c11): this preserves the semantics. For a fresh-context delivery the queue now emits its own pending:<runId> provider-thread row instead of borrowing the active run's thread. On promotion, storedProviderThread is that unstarted row on the same instance (firstRunOrdinal/nativeThreadRef null), so it's reused rather than minting a second pending:<run>:fresh row. That matches the reservation design in 82c4c11. Non-fresh deliveries are unchanged, because queueProviderThread is still the fallback. A reserved row whose queued run is cancelled stays unused, the same as for any queued switch to a new instance, so this adds no new kind of orphaned thread.

Verdict

APPROVE. All four claimed baseline failures are fixed, I found no regressions, and no tests were weakened. Findings 1 and 2 predate this PR and should be follow-ups in one change to the promotion gate.

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