Skip to content

feat(core): add watchdog runtime and prompts#13678

Open
friel-openai wants to merge 16 commits intomainfrom
dev/friel/watchdog-runtime-and-prompts
Open

feat(core): add watchdog runtime and prompts#13678
friel-openai wants to merge 16 commits intomainfrom
dev/friel/watchdog-runtime-and-prompts

Conversation

@friel-openai
Copy link
Contributor

Summary

  • add watchdog runtime support and lifecycle management for agent threads
  • add watchdog-specific prompts and role configuration, including model overrides
  • preserve watchdog-facing control surfaces such as list_agents, close_agent, and parent compaction hooks

Dependencies

Notes

  • this PR is intended to land after the agent inbox and fork reference work
  • the branch is reviewable on its own, but it is not build-complete without those dependencies

Copy link
Contributor

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

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: 9ad5302861

ℹ️ 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 +734 to +741
if compacting.contains(&parent_thread_id) {
if parent_has_active_turn {
return Ok(WatchdogParentCompactionResult::AlreadyInProgress {
parent_thread_id,
});
}
compacting.remove(&parent_thread_id);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Block duplicate parent compactions while one is pending

compact_parent_for_watchdog_helper reads parent_has_active_turn before locking watchdog_compactions_in_progress, then removes an existing marker whenever that stale read is false. Two concurrent helpers can both pass this window and both submit Op::Compact, creating duplicate compactions. Keep the in-progress marker authoritative until the first request is known finished.

Useful? React with 👍 / 👎.

friel-openai added a commit that referenced this pull request Mar 6, 2026
friel-openai added a commit that referenced this pull request Mar 6, 2026
Adjust the watchdog compaction regression test to match the new duplicate-blocking behavior instead of pre-seeding the in-progress set.

Also relax the MCP codex-tool assertion so it checks for developer instructions by substring, which keeps the test valid when branch-added root/subagent prompt text is coalesced into the same developer message.
friel-openai added a commit that referenced this pull request Mar 6, 2026
Allow subagent spawning at the configured max depth by only disabling the agents feature when child depth exceeds the limit.

Update the affected codex-core tests to match the current role spec output and context-free spawn config behavior, and keep the depth-boundary spawn test on the plain spawn path while asserting that the spawned thread is actually registered.
friel-openai added a commit that referenced this pull request Mar 6, 2026
Rename the branch-local collab inbox payload, constants, helper names,
and prompt text to agent inbox terminology without touching upstream
collaboration mode surfaces.

This keeps the watchdog/runtime behavior intact while removing the
branch-added collab naming that leaked into the stack.
Adjust the watchdog compaction regression test to match the new duplicate-blocking behavior instead of pre-seeding the in-progress set.

Also relax the MCP codex-tool assertion so it checks for developer instructions by substring, which keeps the test valid when branch-added root/subagent prompt text is coalesced into the same developer message.
Allow subagent spawning at the configured max depth by only disabling the agents feature when child depth exceeds the limit.

Update the affected codex-core tests to match the current role spec output and context-free spawn config behavior, and keep the depth-boundary spawn test on the plain spawn path while asserting that the spawned thread is actually registered.
Set the built-in  role to use , matching the existing lightweight worker-style roles.

This keeps long-running helper agents on the cheaper/faster model path by default while preserving per-role model override support in config.
Stop hardcoding model and spawn-mode defaults for the built-in explorer, fast-worker, and awaiter roles.

That behavior can be expressed through local config instead, which keeps the branch feature focused on per-role override support rather than policy.
Align the branch ambient role spawn behavior with upstream by making spawn the default when neither the tool call nor the role config specifies a spawn mode.

This keeps the branch delta smaller while letting local config carry role-specific fork defaults where needed.
Stop prepending root and subagent prompt files into session developer instructions during startup. Main no longer does this, and keeping the branch-local wrapping caused compaction and rollback snapshot drift in core tests.\n\nKeep the watchdog-specific prompt loader for watchdog check-ins, but leave ordinary session developer instructions sourced directly from config like upstream.
Restore the branch-local root/subagent prompt injection in codex-core and update the rollback snapshot to match. This keeps the watchdog branch aligned with its own role-prompt behavior instead of silently adopting main.s prompt layout.
@friel-openai friel-openai force-pushed the dev/friel/watchdog-runtime-and-prompts branch from 8aa5c15 to a6154b1 Compare March 6, 2026 23:09
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