Skip to content

revert(codex): remove superseded subagent status port - #68

Closed
lastobelus wants to merge 1 commit into
lastcode/mainfrom
lastcode/revert-codex-subagent-working-state
Closed

revert(codex): remove superseded subagent status port#68
lastobelus wants to merge 1 commit into
lastcode/mainfrom
lastcode/revert-codex-subagent-working-state

Conversation

@lastobelus

Copy link
Copy Markdown
Owner

Upstream pingdotgg#7937 merged the core stale-Working fix and LastCode's 1170 nightly now carries that implementation. The older LastCode #48 port bundled a different adapter strategy with two independent safeguards, so keeping it as one downstream patch obscures which behavior remains locally owned.

This reverts LastCode #48 in full on top of the nightly that already contains pingdotgg#7937. A separate follow-up port will retain only the still-needed pieces:

Validation:

  • 40 focused Codex adapter, collaboration runtime, and background-liveness tests passed
  • server typecheck passed
  • targeted lint, formatting, and diff checks passed
  • mandatory quick local CI passed before publication

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

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9acf55675b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +133 to +136
// Status-free progress is a description tick, not a restart. A delayed
// progress event after idle must not put the task back in the live set
// (#7128).
if (input.kind === "progress" && input.status === undefined) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep status-free updates from reviving idle tasks

When Claude emits a task_updated with status: paused followed by a metadata-only update such as description or is_backgrounded, the first event maps to idle and removes the task, but this narrowed guard lets the second status-free updated event fall through and add it back as live. The sidebar then remains incorrectly pinned to Working until another terminal update or session exit; ClaudeAdapter.ts:3275-3301 explicitly permits these status-free patches. Retain the same live-set guard for updated events as for progress.

AGENTS.md reference: AGENTS.md:L146-L149

Useful? React with 👍 / 👎.

Comment on lines 1144 to 1145
});
// A child turn can start before this activity registers the child.
// The foreign-notification suppressor records that live turn but
// cannot emit agent lifecycle until identity is known. Replay the
// explicit start after first registration so sidebar liveness sees
// genuine work; a trailing interaction with no live turn remains
// the status-free metadata update mapped by CodexAdapter.
const preRegistrationLiveTurn = (yield* Ref.get(collabChildLiveTurnsRef)).get(
item.agentThreadId,
);
if (!existingChild && item.kind === "interacted" && preRegistrationLiveTurn) {
yield* emitEvent({
kind: "notification",
threadId: options.threadId,
...(registeredChild?.spawnTurnId ? { turnId: registeredChild.spawnTurnId } : {}),
method: "collabAgent/turnStarted",
payload: {
agentThreadId: item.agentThreadId,
...(registeredChild?.nickname ? { nickname: registeredChild.nickname } : {}),
...(registeredChild?.role ? { role: registeredChild.role } : {}),
agentPath: item.agentPath,
},
});
}
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve pre-registration child starts

When a child turn/started arrives before registration and its first subAgentActivity is interacted, the foreign-notification suppressor records and discards that start, but this path now returns without replaying it after registration. CodexAdapter.ts:593-595 intentionally emits nothing for interacted, so no task.started or running update reaches liveness and the thread can appear idle while the child is still working. Replay the recorded live turn for this first-registration case before returning.

AGENTS.md reference: AGENTS.md:L146-L149

Useful? React with 👍 / 👎.

@lastobelus

Copy link
Copy Markdown
Owner Author

Both Codex findings are valid. An isolated revert would temporarily reintroduce the generic status-free update bug and the pre-registration child-start race. Closing this PR unmerged; the replacement will atomically revert #48 and reapply only the independently needed pingdotgg#7468 and narrowed pingdotgg#7848 changes on top of merged pingdotgg#7937.

@lastobelus lastobelus closed this Aug 23, 2026
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