Skip to content

Conversation

@ColeMurray
Copy link
Owner

Summary

  • move prompting participant + OAuth token resolution concerns back into SessionDO
  • keep SessionPullRequestService focused on PR orchestration (push, branch resolution, artifact writes, PR creation/manual fallback)
  • simplify manual fallback code by collapsing multi-helper metadata lookup into one method
  • remove unused fallback-reason plumbing between DO and service
  • add concise method-level docstrings on service methods and key refactor seams

Tests

  • npm run typecheck --workspace @open-inspect/control-plane
  • npm run test -- src/session/pull-request-service.test.ts
  • npm run test:integration -- test/integration/create-pr.test.ts

Add standalone guide for configuring OpenAI ChatGPT subscription
credentials to use Codex models (GPT 5.2, 5.2 Codex, 5.3 Codex).
Covers obtaining OAuth tokens via OpenCode, adding repo secrets,
and model selection. Links from GETTING_STARTED.md.
Highlight OpenAI Codex model support in the Overview and Key Features
sections, with a link to the setup guide.
@github-actions
Copy link

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@github-actions
Copy link

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@greptile-apps
Copy link

greptile-apps bot commented Feb 12, 2026

Greptile Overview

Greptile Summary

Refactored PR creation flow by extracting orchestration logic from SessionDO into a dedicated SessionPullRequestService class. The SessionDO now only handles participant identity and OAuth token resolution, while the service manages branch pushing, artifact creation, and PR API calls.

Key improvements:

  • Collapsed multiple manual fallback helpers (getExistingManualBranchArtifact, getCreatePrUrlFromManualArtifact, buildManualPrFallbackResponse) into cleaner service methods (findExistingManualPrUrl, buildManualPrFallbackResult)
  • Simplified resolvePromptingUserAuthForPR to return SourceControlAuthContext | null instead of complex union types
  • Added comprehensive unit tests (pull-request-service.test.ts) and integration tests (create-pr.test.ts)
  • Added documentation for OpenAI model support (docs/OPENAI_MODELS.md)

The refactoring maintains backward compatibility and all tests pass.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the session pull request creation flow by moving PR orchestration into a dedicated SessionPullRequestService, while keeping SessionDO responsible for resolving the prompting participant and OAuth context. Adds new unit/integration coverage for PR creation and documents OpenAI model setup.

Changes:

  • Introduce SessionPullRequestService to orchestrate branch resolution, pushes, artifact writes, and PR creation/manual fallback.
  • Update SessionDO.handleCreatePR to resolve prompting participant/auth and delegate PR creation to the new service.
  • Add integration/unit tests for PR creation flows and add OpenAI model configuration documentation (linked from README and Getting Started).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/control-plane/test/integration/create-pr.test.ts Adds integration coverage for create-PR endpoint error cases, manual fallback behavior, and artifact handling.
packages/control-plane/src/session/pull-request-service.ts New service encapsulating PR orchestration (branch resolution, push, artifact writes, PR creation/manual fallback).
packages/control-plane/src/session/pull-request-service.test.ts Unit tests for the new PR service covering error paths, manual fallback, PR creation, and manual artifact reuse.
packages/control-plane/src/session/durable-object.ts Delegates PR orchestration to the new service; keeps participant/auth resolution in the DO.
docs/OPENAI_MODELS.md New guide describing OpenAI model setup via OAuth credentials.
docs/GETTING_STARTED.md Links to OpenAI model setup guide in the deployment walkthrough.
README.md Mentions multi-provider model support and links to OpenAI model setup documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@github-actions
Copy link

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@ColeMurray ColeMurray merged commit ec0063e into main Feb 12, 2026
10 checks passed
@ColeMurray ColeMurray deleted the refactor/session-pr-service branch February 12, 2026 08:41
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