Skip to content

fix(codex): restore pre-registration child liveness - #7848

Closed
lastobelus wants to merge 10 commits into
pingdotgg:mainfrom
lastobelus:fix/codex-subagent-working-state
Closed

lastobelus wants to merge 10 commits into
pingdotgg:mainfrom
lastobelus:fix/codex-subagent-working-state

Conversation

@lastobelus

@lastobelus lastobelus commented Aug 21, 2026 •

Copy link
Copy Markdown

Upstream #7937 fixed the stale-Working bug by ignoring trailing collabAgent/activity { activityKind: "interacted" } events. A complementary registration race remains: Codex can emit a real child turn/started before either notification that identifies that child.

The runtime now records that suppressed live turn and replays an explicit collabAgent/turnStarted only when a later registration proves the turn is still live. Terminal child errors clear the recorded turn, remain authoritative across late registration, and emit a bounded start-to-failed lifecycle so every client gets an anchor without leaving the child live. Retryable errors retain the live turn. Child-scoped errors stay off the parent event stream.

This PR is intentionally limited to that residual race:

Related issue: #7726

LastCode counterpart: lastobelus#69

Validation:

  • 43 focused Codex collaboration runtime, wire, and adapter tests passed
  • server typecheck passed
  • targeted lint, formatting, and diff checks passed
  • three bounded review rounds completed; all verified findings were fixed

Prepared by gpt-5.6-sol through the Codex harness.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 21, 2026
@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 114bf674-3bec-4a4f-bd2e-cdfaba3d156f

📥 Commits

Reviewing files that changed from the base of the PR and between 592c598 and 3a836d7dce348331773566e6fd0c9cd9bb04c656.

📒 Files selected for processing (6)
  • apps/server/src/orchestration/ThreadBackgroundLiveness.test.ts
  • apps/server/src/orchestration/ThreadBackgroundLiveness.ts
  • apps/server/src/provider/Layers/CodexAdapter.test.ts
  • apps/server/src/provider/Layers/CodexAdapter.ts
  • apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts
  • apps/server/src/provider/Layers/CodexSessionRuntime.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change prevents descriptive task updates from reviving idle tasks. It preserves child-agent identity during late registration and replays recorded live turns. Tests cover liveness, child event sequencing, and pre-registration turn replay.

Changes

Lifecycle and liveness behavior

Layer / File(s) Summary
Task liveness event handling
apps/server/src/orchestration/ThreadBackgroundLiveness.ts, apps/server/src/orchestration/ThreadBackgroundLiveness.test.ts
Status-free updated events no longer revive idle tasks. Genuine started events still restore "working" liveness.
Child-agent lifecycle synchronization
apps/server/src/provider/Layers/CodexAdapter.ts, apps/server/src/provider/Layers/CodexSessionRuntime.ts, apps/server/src/provider/Layers/CodexAdapter.test.ts, apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts
"interacted" events preserve lifecycle state. Child registration preserves existing metadata and replays synthetic turnStarted events for previously recorded live turns.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 3a836

The PR prevents stale interaction events from reviving idle subagents while restoring genuinely live work discovered late. A bounded lifecycle edge case remains if child turns overlap, complete out of order, or lose terminal notifications, which could cause stop or recovery handling to miss active work; merge is reasonable with explicit owner awareness and follow-up.

Suggested reviewers: t3dotgg, juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary fix: restoring liveness for child agents registered after their turns start.
Description check ✅ Passed The description clearly explains the race, implementation, scope, related issues, and validation results; UI details are not applicable.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Aug 21, 2026
@lastobelus
lastobelus force-pushed the fix/codex-subagent-working-state branch from 489ad2e to 3a836d7 Compare August 21, 2026 22:09
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 21, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
@lastobelus
lastobelus marked this pull request as ready for review August 21, 2026 22:37
@lastobelus

Copy link
Copy Markdown
Author

@coderabbitai review

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 21, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes shared Codex event routing and child lifecycle state, including suppression, synthetic replay, terminal-error handling, and Stop interruption tracking. Because these changes can alter parent visibility and agent liveness across several event-ordering scenarios, the runtime behavior warrants human review.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 22, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 22, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 22, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 22, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 23, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
@lastobelus
lastobelus force-pushed the fix/codex-subagent-working-state branch from 3a836d7 to 94002d8 Compare August 23, 2026 19:33
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 23, 2026 19:34

Dismissing prior approval to re-evaluate 94002d8

@lastobelus lastobelus changed the title fix(codex): keep idle subagents from reviving on interaction fix(codex): restore pre-registration child liveness Aug 23, 2026
Comment thread apps/server/src/provider/Layers/CodexSessionRuntime.ts Outdated
@lastobelus

Copy link
Copy Markdown
Author

Refactored after #7937 merged: this PR no longer changes the interacted adapter mapping and no longer includes #7468. It now isolates only the complementary pre-registration live-turn replay. LastCode reconciliation: lastobelus#69.

@lastobelus
lastobelus force-pushed the fix/codex-subagent-working-state branch from 94002d8 to 8bd707f Compare August 23, 2026 20:57
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 23, 2026
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 23, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 29, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 30, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 30, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 31, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Aug 31, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 1, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Codex can emit a trailing interacted notification after a child turn
completes, and can emit a real child turn start before the activity that
registers that child. Treating every interaction as running revives idle
children, while treating every interaction as metadata can miss a
genuinely live pre-registration turn.

This port retains the complete upstream candidate:
- pingdotgg#7848 maps interacted to a status-free identity update
and replays an explicit start only when registration finds a recorded
live turn.
- pingdotgg#7468 hardens generic task liveness so status-free
task.updated events cannot revive an idle task; its original authored
commit is preserved.

Upstream PR: pingdotgg#7848
Generic hardening PR: pingdotgg#7468
Issue: pingdotgg#7726

Validation:
- 87 focused adapter, runtime, liveness, and client-fold tests passed
- focused lint and formatting passed
- quick local CI passed before the review fix; final exact-head full CI
will run before merge

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
lastobelus added a commit to lastobelus/lastCode that referenced this pull request Sep 2, 2026
Upstream pingdotgg#7937 merged the core stale-Working fix by ignoring trailing
Codex `interacted` events. LastCode's nightly adopted that
implementation, but the rebased #48 commit still grouped two independent
safeguards under the old composite port.

This branch makes the ownership explicit and atomic:

1. revert LastCode #48;
2. reapply the generic status-free `task.updated` liveness hardening
from pingdotgg#7468;
3. reapply the pre-registration child-turn replay from the narrowed
pingdotgg#7848, including its terminal-error ordering and
cross-client anchor fixes.

The small net diff is intentional: the nightly had already resolved the
upstream provenance without exposing an intermediate LastCode state that
drops either still-needed safeguard.

Upstream sources observed 2026-08-23 PDT:

- pingdotgg#7937 merged at head `db85d831d4074cbbbe6c1975b7fa2421f9c10df4` (merge
`4e00471d1ab340b46742565bb6ce6462160b4d0c`)
- pingdotgg#7848 open at reviewed head `1123f75e9`
- pingdotgg#7468 remains the upstream owner of generic liveness hardening

Import method: exact commits applied with `cherry-pick -x`; review fixes
were authored in pingdotgg#7848 first and then ported into this stack.

Validation:

- 52 focused Codex adapter, collaboration runtime, wire, and
background-liveness tests passed
- server typecheck passed
- targeted lint, formatting, and diff checks passed
- three bounded review rounds completed: correctness/edge cases,
KISS/best practices, and final regression review
- mandatory quick local CI passed on head `a6f42da8a`

Prepared by gpt-5.6-sol through the Codex harness.

---------

Co-authored-by: Jeremy Schoemaker <jeremy@shoemoney.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants