Skip to content

DRAFT: Submission bot opens a github PR #4044

Open
tintinthong wants to merge 9 commits intoget-bot-runner-to-run-headless-commandfrom
cs-9945-submission-bot-open-a-github-pr
Open

DRAFT: Submission bot opens a github PR #4044
tintinthong wants to merge 9 commits intoget-bot-runner-to-run-headless-commandfrom
cs-9945-submission-bot-open-a-github-pr

Conversation

@tintinthong
Copy link
Contributor

No description provided.

@tintinthong tintinthong changed the base branch from main to get-bot-runner-to-run-headless-command February 23, 2026 14:47
Copy link

@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: 935b2c0665

ℹ️ 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 65 to 68
let prParams: Parameters<CreatePullRequest>[0] = {
...params,
head: HARDCODED_PR_HEAD_BRANCH,
};

Choose a reason for hiding this comment

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

P1 Badge Respect caller-provided PR head branch

openPullRequest currently replaces params.head with a hardcoded branch, so every PR is opened from test-submissions regardless of the event/listing-specific branch passed by callers. This breaks branch isolation and can open the wrong PR (or fail if that branch is absent), which makes the submission flow unreliable for any room-specific listing updates.

Useful? React with 👍 / 👎.

Comment on lines 169 to 172
if (eventContent.type === 'pr-listing-create') {
// Temporary workaround: handle PR creation directly until this flow is moved to a proper command path.
await openCreateListingPR({
eventContent,

Choose a reason for hiding this comment

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

P1 Badge Return after direct pr-listing-create handling

For pr-listing-create, this function calls openCreateListingPR but then continues into the generic enqueue path instead of exiting, so the same trigger can both open a PR directly and enqueue a run-command job. In environments where that event type has an allowed command registration, this causes duplicated/competing side effects for a single Matrix event.

Useful? React with 👍 / 👎.

@tintinthong tintinthong marked this pull request as draft February 23, 2026 14:52
@github-actions
Copy link

Preview deployments

@github-actions
Copy link

github-actions bot commented Feb 23, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   1h 33m 21s ⏱️ - 3m 27s
1 869 tests +2  1 854 ✅ +2  15 💤 ±0  0 ❌ ±0 
1 884 runs  +2  1 869 ✅ +2  15 💤 ±0  0 ❌ ±0 

Results for commit b9ab851. ± Comparison against base commit 2bfa7ec.

♻️ This comment has been updated with latest results.

@tintinthong tintinthong force-pushed the get-bot-runner-to-run-headless-command branch from 6317949 to 2bfa7ec Compare February 25, 2026 04:21
@tintinthong tintinthong force-pushed the cs-9945-submission-bot-open-a-github-pr branch from 49fabaa to ff1a5c3 Compare February 25, 2026 09:18
@tintinthong tintinthong requested a review from Copilot February 25, 2026 14:09
@tintinthong tintinthong marked this pull request as ready for review February 25, 2026 14:09
Copy link
Contributor

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

This pull request implements a submission bot feature that automates the creation of GitHub pull requests for catalog listings. The bot listens to Matrix events, processes submission requests, collects listing files, and creates PRs in the boxel-catalog repository.

Changes:

  • Added GitHub API integration using Octokit for creating branches, commits, and pull requests
  • Implemented submission workflow with create-submission command that generates SubmissionCard instances
  • Refactored bot-runner timeline handling to support the new pr-listing-create event type with userId tracking

Reviewed changes

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

Show a summary per file
File Description
pnpm-lock.yaml Added @octokit/rest and @octokit/types dependencies for GitHub API integration
packages/runtime-common/github-submissions.ts New module for encoding/decoding Matrix room IDs into branch names using base64url
packages/runtime-common/tests/github-submissions-test.ts Test coverage for branch name encoding and submission metadata extraction
packages/runtime-common/bot-trigger.ts Added required userId field to BotTriggerEvent validation
packages/runtime-common/index.ts Exported github-submissions module
packages/base/matrix-event.gts Added userId field to BotTriggerContent interface
packages/base/command.gts Added CreateSubmissionInput and CreateSubmissionResult types
packages/host/app/commands/create-submission.ts New command to prepare submission data and create SubmissionCard instances
packages/host/app/commands/index.ts Registered CreateSubmissionCommand in the command registry
packages/host/app/commands/bot-requests/send-bot-trigger-event.ts Added userId to bot trigger events
packages/host/app/commands/bot-requests/create-listing-pr-request.ts Updated to use pr-listing-create event type and include listingName
packages/host/tests/integration/commands/* Test coverage for bot trigger events and submission creation
packages/bot-runner/lib/github.ts New GitHub client implementation using Octokit for PR operations
packages/bot-runner/lib/create-listing-pr-handler.ts Handler for pr-listing-create events including branch creation and PR opening
packages/bot-runner/lib/command-runner.ts Command runner with special handling for pr-listing-create workflow
packages/bot-runner/lib/timeline-handler.ts Refactored to use CommandRunner for event processing
packages/bot-runner/tests/* Comprehensive test coverage for GitHub operations and command handling
packages/bot-runner/main.ts Integrated GitHub client into bot-runner initialization
packages/bot-runner/package.json Added Octokit dependencies
packages/catalog-realm/submission-card/submission-card.gts New SubmissionCard definition for tracking submissions
packages/catalog-realm/* Added submission card listing and demo instance
packages/matrix/scripts/setup-submission-bot.ts Updated to register create-submission command for pr-listing-create events
packages/experiments-realm/bot-request-demo.gts Updated demo to use pr-listing-create event type
docs/* Added comprehensive documentation for the submission flow
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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


Headless command execution details are documented here:

- [commands-in-headless-chrome.md](/Users/tintinthong/github/boxel/docs/commands-in-headless-chrome.md)
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

This documentation link contains an absolute path to a user's local file system ("/Users/tintinthong/github/boxel/..."). This should be a relative path like "commands-in-headless-chrome.md" or "./commands-in-headless-chrome.md".

Suggested change
- [commands-in-headless-chrome.md](/Users/tintinthong/github/boxel/docs/commands-in-headless-chrome.md)
- [commands-in-headless-chrome.md](./commands-in-headless-chrome.md)

Copilot uses AI. Check for mistakes.
commitSha: string;
}

const HARDCODED_REVIEWER = 'tintinthong';
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The HARDCODED_REVIEWER constant contains a specific GitHub username ('tintinthong'). This should be configurable via an environment variable to allow different reviewers for different deployments or to support multiple reviewers.

Suggested change
const HARDCODED_REVIEWER = 'tintinthong';
const HARDCODED_REVIEWER = process.env.GITHUB_DEFAULT_REVIEWER ?? 'tintinthong';

Copilot uses AI. Check for mistakes.
Copy link

@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: b9ab851b3b

ℹ️ 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 +81 to +83
let result: RunCommandResponse = await job.done;
await this.createListingPRHandler.addContentsToCommit(eventContent, result);
await this.createListingPRHandler.openCreateListingPR(

Choose a reason for hiding this comment

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

P1 Badge Skip PR side effects when run-command fails

The pr-listing-create branch continues into addContentsToCommit/openCreateListingPR even when job.done resolves to a non-ready result. run-command returns { status: 'error', error: ... } for common failures (permissions/invalid command input) without throwing, so this path can create an empty branch and then silently exit on “No commits between” instead of surfacing the real failure. Gate the GitHub write/PR steps on result.status === 'ready' and propagate result.error when it is not.

Useful? React with 👍 / 👎.

@tintinthong
Copy link
Contributor Author

  • fileContent field is fine as FieldDef bcos it creates a snapshot
  • remove labels pls and just create the submission without labels. put all info in body of PR

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.

2 participants