Skip to content

Unify repository context across planning and execution - #197

Merged
tzhouam merged 1 commit into
mainfrom
codex/repository-context-boundary-20260926
Sep 26, 2026
Merged

tzhouam merged 1 commit into
mainfrom
codex/repository-context-boundary-20260926

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Planning and execution previously read adapter state through separate paths. A malformed known adapter failed planning but could be silently treated as absent during execution, allowing default branch and risk policy to replace its configured policy.

This change resolves the checkout, planner capabilities, protected branches, and high-risk modules through one application-level repository context. Execution rechecks that context before starting and blocks if the adapter is malformed or changed since planning. It also prevents an unresolved adapter path from claiming the repo.path capability. Legacy adapter absence remains supported.

Validation: full local pytest suite; focused repository-context, adapter, engine, contract, lifecycle, CLI, and Phase B tests; wheel build and installed import/runtime-resource smoke; strict SPEC freshness and doc/knowledge linters; git diff --check.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 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-26T12:03:37.111128Z 6191484 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 b4826e5 into main Sep 26, 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: 6191484bdb

ℹ️ 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 194 to +196
return self._execute(resolution.playbook, spec, run_dir,
resolution_mode=resolution.mode, tier=resolution.tier)
resolution_mode=resolution.mode, tier=resolution.tier,
planned_context=repo_context)

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 drift-blocked runs out of resume

When REPO_PATHS or the adapter manifest changes while confirmation is pending, the context comparison occurs only after run_task has created the run directory and written task.json. resume_last() treats that artifact as resumable and calls _execute without planned_context, so the next resume accepts the changed context and executes the run that this drift check just refused, potentially against a different checkout or policy. Recheck before persisting the run, or persist and enforce the planned context during resume.

Useful? React with 👍 / 👎.

Comment on lines +27 to +30
def adapter_for(self, repo: str) -> RepoAdapter | None:
name = repo.replace("-", "_")
try:
return AdapterRegistry(self.settings.adapters_dir).resolve(name=name)

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 Isolate adapter failures to the requested repository

When the adapters directory contains a malformed manifest for an unrelated repository, AdapterRegistry.resolve() eagerly loads every adapter through all(), so that unrelated AdapterError aborts this lookup before the requested adapter can match. Because ambient_repo_path() now uses this path, even a repository with a valid REPO_PATHS checkout can lose relative chat-path resolution or crash run-service readiness due solely to another repository's broken adapter. Load only the requested candidate or otherwise ignore failures outside the requested repository while retaining fail-closed behavior for its own adapter.

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