Skip to content

Extract headless run service behind Strict SDK and MCP - #187

Merged
tzhouam merged 1 commit into
mainfrom
codex/headless-service-20260926
Sep 25, 2026
Merged

tzhouam merged 1 commit into
mainfrom
codex/headless-service-20260926

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

The embedded Strict SDK currently constructs the MCP server core and reaches the workflow orchestrator through a CLI module. This change moves the durable run queue, policy checks, reserve/poll logic, and knowledge reads into a headless RunService; the SDK and MCP transport now call that same service. The CLI keeps its existing Copilot import path as a compatibility export.

The SDK adds a typed StrictRuntimeConfig for repository/checkout/backend binding and typed Strict and quality result projections, retaining the existing payload for wire compatibility. Explicit configuration disables dotenv loading, and the run service passes the selected backend and repository binding to isolated children. Public result decoding reports malformed structures through ResultDecodeError.

Validation: complete offline suite passed 1,528 tests before the final backend propagation and dotenv test additions; targeted SDK/MCP tests passed 73 after those additions. SPEC freshness and doc link/citation checks passed. An installed wheel constructed the headless runtime without importing MCP or CLI modules.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T20:24:20.586247Z 2608b25 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tzhouam
tzhouam merged commit 1afab6c into main Sep 25, 2026
2 checks passed

@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: 2608b25e99

ℹ️ 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 +124 to +125
if config.run_root:
overrides["run_root"] = config.run_root

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 Normalize the configured run root before launching children

When StrictRuntimeConfig.run_root is relative (for example, "runs"), the parent reserves the run under <cwd>/runs, but _launch starts the child with cwd=<cwd>/runs while exporting RUN_ROOT=runs. The child consequently searches <cwd>/runs/runs/<run_id> and exits without finding the reservation, leaving every such review interrupted. Resolve this value to an absolute path before constructing Settings or exporting it to the child.

Useful? React with 👍 / 👎.

finding_rechecks=tuple(rechecks),
rechecks_complete=complete,
recheck_missing=tuple(missing),
stale=bool(raw.get("stale", False)),

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 Reject malformed stale flags instead of coercing them

If a corrupted, older, or custom service payload returns a non-boolean stale value, this coercion silently accepts it; notably, "false" becomes True, so an embedded host can incorrectly discard a valid review as stale. This also occurs in _quality_result. Since this boundary advertises ResultDecodeError for malformed structures and already validates rechecks_complete, validate stale as an actual boolean before constructing either typed result.

Useful? React with 👍 / 👎.

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