Skip to content

Converge the imported Codex background-wait hold with upstream #823

Open

Description

@lastobelus

Source contribution

https://redirect.github.com/lastobelus/lastCode/pull/791 imports the Codex background-wait hold: a Codex thread that marks a background command with t3_background_wait stays in Working until the command ends.

Upstream change

https://redirect.github.com/pingdotgg/t3code/pull/37572, "fix(codex): support explicit background waits". Open and unmerged. A maintainer took it over on Nov 19 PT and it is still changing, so the import is a snapshot, not the final shape.

Pinned upstream head: bfcb55dc7fc10958e4386473a16a16b6a03f6ca2 (rechecked for the pre-default-on re-port).

What remains uncertain

  • Whether upstream merges this PR, replaces it, or closes it.
  • How far the merged version will differ from the pinned head, in the Codex adapter and in the shared tool description.
  • The LastCode flag that gates the hold is a separate commit, so only the import commit needs to converge.

How this converges

  • Each checkpoint compares upstream's head with the pinned head above and reports drift here. It does not re-port on every change.
  • Re-port from upstream's head at two points: before the LastCode flag defaults to on, and when upstream merges or closes the PR.
  • When the upstream change reaches a nightly that LastCode absorbs, the import commit retires and only the flag seam remains, until the flag itself is removed.

Activity

  1. added
    carry-convergence
    on Nov 22, 2026
  2. lastobelus commented on Nov 23, 2026

    @lastobelus
    OwnerAuthor

    Differences from the pinned upstream head found while break-testing (Nov 22 PT)

    Both were found by reading source at the pinned head 5e048c23d68396b46e7a2e387755da157dd04bee and by live runs of the LastCode import. Neither was verified against a running upstream build.

    1. The tool is hidden from Codex threads. The rule that hides t3_background_wait from threads whose provider does not declare supportsBackgroundWait landed after the pinned head and its merge base, in https://redirect.github.com/pingdotgg/t3code/pull/38348. The pinned head does not declare the capability for Codex, so once it is rebased onto a base with that rule, a Codex agent cannot list or call the tool. The import was faithful; LastCode adds the declaration in a separate commit, gated by the flag.

    2. A delegated Codex child reports too early. The pinned head clears the hold before it queues the wake turn, and the wake turn belongs to no delegated task. A parent therefore receives the child's interim message as the completed result and never receives the command's result. LastCode fixes this in a separate commit using its existing mechanism for carrying task ownership across that handoff. Part of this depends on how LastCode's delegation works, so upstream may or may not see the same symptom.

    When re-porting from a newer upstream head, check whether upstream has addressed either point before keeping the LastCode commits.

  3. lastobelus commented on Nov 23, 2026

    @lastobelus
    OwnerAuthor

    Upstream drift, Nov 23 PT: head moved, PR still open

    https://redirect.github.com/pingdotgg/t3code/pull/37572

    • New head: bfcb55dc7fc10958e4386473a16a16b6a03f6ca2 (Nov 22, 23:07 PT). Pinned head was 5e048c23d68396b46e7a2e387755da157dd04bee.
    • State: open, not merged, not a draft. GitHub reports it mergeable.
    • Labels: takeover:needs-julius, needs-rebase, size:L, vouch:unvouched. needs-rebase was applied about half an hour before the new head was pushed and has not been removed yet; that label closes a PR after 7 days without activity.

    What the new head is. One commit on top of the pinned head: a merge of upstream main. Comparing the PR's own diff before and after the merge (5 files, +402 −56 both times):

    • Codex adapter and its tests: unchanged.
    • Eval cases: unchanged.
    • t3_background_wait tool description: reworded. Upstream main had dropped the provider list from the old text, and the merge resolves to: "Keep this thread Working while awaited tasks run. Pass task IDs after launch (Codex: exec session IDs). waiting=false clears without stopping tasks. Skip dev servers/watchers." The pinned version ended with "Claude/Codex/OpenCode."
    • Context budget number: updated to match.

    Earlier difference 1 now applies at upstream's head. The new head sits on a base that hides the tool from providers that do not declare supportsBackgroundWait, and the Codex adapter at this head still does not declare it. Found by reading source at the new head, not by running an upstream build.

    No re-port is triggered by this alone: the re-port points stay "before the LastCode flag defaults to on" and "when upstream merges or closes the PR". The tool description is the only imported text that would change in a re-port from this head.

  4. lastobelus commented on Nov 27, 2026

    @lastobelus
    OwnerAuthor

    Pre-default-on upstream comparison

    Upstream PR 37572 is open at bfcb55dc7fc10958e4386473a16a16b6a03f6ca2. Its first parent is the previous pin, 5e048c23d68396b46e7a2e387755da157dd04bee, and its second parent is upstream main. Comparing each version against its respective base gave identical adapter, adapter test, and eval changes. The tool description and generated context budget were the only changed parts of the import.

    LastCode had the wording from the merge's upstream-main parent, which lacked the Codex exec session ID hint. The re-port takes the merged wording verbatim. It preserves the two downstream fixes because the new upstream head still omits Codex's supportsBackgroundWait declaration and does not carry delegated task ownership through the wake.

    The earlier drift report was manual. The re-port adds a check to publishing checkpoint runs. It reads the pin from the source being published and reports changed heads, closure, or merge here. A live read-only check matched the new pin, and fixtures exercised reporting and publication. The flag’s default is handled separately. This issue stays open for convergence when upstream merges or closes its PR.

  5. lastobelus commented on Nov 29, 2026

    @lastobelus
    OwnerAuthor

    Known limit of the drift check, recorded as a follow-up (declined in #884, the fix PR from the body review tracked in #824; line references at its head 84b52321889e0c47166f412df2e383bcaadae1bd).

    scripts/lastcode-upstream-import-drift.ts compares the pinned head in scripts/lastcode-upstream-imports.json with the upstream PR's current head and state. It reports that upstream moved; it does not compare code. It therefore cannot tell that the fork's copy has changed underneath an unchanged pin, which is the direction #884 moves in (see the next comment once it merges).

    Also skipped today: the check runs only on a publishing checkpoint, not on a dry run, and not on the recovery early-return path in scripts/lastcode-checkpoint.ts.

    Symptom: a checkpoint reports "no drift" while the imported code and the upstream PR differ. Not fixed in #884 because a code-level comparison is a larger tool than the null-body guard that PR needed. Suggested direction: on each report, also diff the imported paths against the pinned upstream commit and print the size of the fork-only delta, so growth is visible.

  6. lastobelus commented on Nov 29, 2026

    @lastobelus
    OwnerAuthor

    Intentional fork divergence inside the imported code, as of 96e964745ffdceaea116c6ec9ffb2a05e063f360 (#884, merged Nov 28 2026 PT). The pin is unchanged at bfcb55dc7fc10958e4386473a16a16b6a03f6ca2, so the drift check will keep reporting "no drift"; this comment is the record of what the fork carries on top of upstream PR 37572.

    Fork-only state and behaviour in upstream-owned apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts:

    Elsewhere, outside the import but touching the same lifecycle:

    • apps/server/src/orchestration-v2/ProjectionStore.ts: four recovery queries also select provider threads with a non-empty owedBackgroundResults.
    • packages/contracts/src/orchestrationV2.ts: optional resultDeliveryLost on restart-cancelled background work.
    • The t3_background_wait tool description is reworded for the wrapper.

    None of this changes the upstream wire protocol. When upstream merges or reshapes its PR, these are the seams to re-seat: the owed-result map and its three lifecycle hooks in the Codex adapter. Everything else lives in fork-owned modules (LastCodeBackgroundWait.ts, LastCodeWrappedBackgroundWait.ts, LastCodeLostBackgroundResults.ts).

  7. lastobelus commented on Dec 1, 2026

    @lastobelus
    OwnerAuthor

    Upstream import drift

    Upstream PR is closed.

    • Pinned head: bfcb55dc7fc10958e4386473a16a16b6a03f6ca2
    • Observed head: bfcb55dc7fc10958e4386473a16a16b6a03f6ca2
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

    carry-convergence

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions