Skip to content

Allow repo-less sessions from web composer#862

Merged
ColeMurray merged 2 commits into
mainfrom
repo-less-home-session-target
Jul 2, 2026
Merged

Allow repo-less sessions from web composer#862
ColeMurray merged 2 commits into
mainfrom
repo-less-home-session-target

Conversation

@ColeMurray

@ColeMurray ColeMurray commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add an explicit No repository option to the homepage session target selector.
  • Create repo-less sessions from the web composer with repoOwner: null and repoName: null.
  • Hide branch selection and omit branch context for repo-less sessions.
  • Default to No repository when the user has no accessible repositories.

Testing

  • npm test -w @open-inspect/web -- src/app/(app)/page.test.tsx
  • npm run typecheck -w @open-inspect/web
  • npm run lint -w @open-inspect/web
  • npm test -w @open-inspect/web

Summary by CodeRabbit

  • New Features
    • Added an explicit “start without a repository” option for session creation.
    • Updated the repository picker to reflect this choice and only show branch selection when a repository is selected.
  • Bug Fixes
    • Improved session startup when no repositories are available, including clearer guidance in the empty state.
  • Tests
    • Added UI flow coverage to ensure sessions can start with a “no repository” target and send the expected session creation payload.

@github-actions

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a NO_REPOSITORY_VALUE sentinel to the Home page so sessions can start without cloning a repository. The selection state, session creation request, branch UI, empty-state copy, and tests were updated to support both repository and no-repository flows.

Changes

No-repository session support

Layer / File(s) Summary
Sentinel value and state derivation
packages/web/src/app/(app)/page.tsx
Introduces the no-repository sentinel and helper functions, derives session target state from the selected value, updates repo and branch loading inputs, and changes repo change handling to clear branch selection when the sentinel is chosen.
Session creation payload with null repo support
packages/web/src/app/(app)/page.tsx
Updates createSessionForWarming to build pending config from sessionTarget, sends null repoOwner/repoName when no repository is selected, conditionally includes branch, and matches pending config against the new target-based fields.
Repo selector UI and branch combobox
packages/web/src/app/(app)/page.tsx
Reworks repository options to include a no-repository entry, updates the displayed label, switches the combobox items source, conditionally renders the branch combobox only for real repositories, and revises the empty-state copy.
Home page UI interaction tests
packages/web/src/app/(app)/page.test.tsx
Adds JSDOM test scaffolding, fetch stubs, a helper for reading the sessions request body, and two user-event tests covering the no-repository selection and empty-repository flows.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: allowing sessions to be created without a repository from the web composer.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch repo-less-home-session-target

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread packages/web/src/app/(app)/page.tsx Outdated
Comment thread packages/web/src/app/(app)/page.tsx Outdated

@open-inspect open-inspect Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary

PR #862, "Allow repo-less sessions from web composer" by @ColeMurray updates the homepage composer to support an explicit No repository target and adds focused tests for repo-less session creation. Reviewed 2 changed files (+232/-38); the implementation is small, consistent with existing repo-less session handling, and I did not find blocking correctness, security, performance, or maintainability issues.

Critical Issues

None found.

Suggestions

None blocking.

Nitpicks

None.

Positive Feedback

  • The session creation payload now clearly sends repoOwner: null and repoName: null and omits branch context for repo-less sessions.
  • The branch selector is hidden when the selected target is not an actual repository, which keeps the UI state aligned with the request payload.
  • The added tests cover both explicit No repository selection and the empty-repository default path.

Questions

None.

Verification

I attempted to run npm test -w @open-inspect/web -- src/app/(app)/page.test.tsx from a temporary PR-head worktree, but dependencies were not installed there, so vitest was unavailable. I did not rerun the full test suite.

Verdict

Approve.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/web/src/app/(app)/page.test.tsx (1)

112-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing coverage for the standard (non-null) repo + branch session-creation flow.

This is the only test file for the Home page, yet both tests exercise the no-repository path. Neither confirms that selecting an actual repo (the pre-existing/default flow) still sends repoOwner/repoName/branch correctly in the POST body. A regression here (e.g. from the sessionTarget refactor mentioned in the PR objectives) would go undetected.

Consider adding a third test that selects repo (already fixtured at lines 28-36) and asserts the create-session payload includes repoOwner: repo.owner, repoName: repo.name, and a branch field.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/web/src/app/`(app)/page.test.tsx around lines 112 - 151, The Home
page tests only cover the no-repository flow, so add coverage for the standard
repository-backed session creation path in the Home test suite. In the existing
`describe("Home")` block, add a test that selects the pre-fixtured `repo` from
the primary selector and submits a session, then assert the POST body created by
`sessionCreateBody()` includes `repoOwner`, `repoName`, and `branch` populated
from that repo. This should verify the `Home`/`sessionTarget` flow still sends
the expected repo fields when a real repository is chosen.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/web/src/app/`(app)/page.tsx:
- Line 76: The warmed-session cache and pending-config matching currently ignore
reasoningEffort, so a session can be reused across different effort settings.
Update the warm-session key and the pendingConfigRef shape/match logic in
page.tsx to include reasoningEffort alongside target, model, and branch, and
make sure any session reset/abort path triggered by config changes also treats
reasoningEffort as a distinct configuration value.

---

Nitpick comments:
In `@packages/web/src/app/`(app)/page.test.tsx:
- Around line 112-151: The Home page tests only cover the no-repository flow, so
add coverage for the standard repository-backed session creation path in the
Home test suite. In the existing `describe("Home")` block, add a test that
selects the pre-fixtured `repo` from the primary selector and submits a session,
then assert the POST body created by `sessionCreateBody()` includes `repoOwner`,
`repoName`, and `branch` populated from that repo. This should verify the
`Home`/`sessionTarget` flow still sends the expected repo fields when a real
repository is chosen.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07b768e8-51a4-4c36-b68f-556892bd9946

📥 Commits

Reviewing files that changed from the base of the PR and between dc678ed and fff3acf.

📒 Files selected for processing (2)
  • packages/web/src/app/(app)/page.test.tsx
  • packages/web/src/app/(app)/page.tsx

Comment thread packages/web/src/app/(app)/page.tsx
@ColeMurray ColeMurray merged commit bfb141a into main Jul 2, 2026
18 checks passed
@ColeMurray ColeMurray deleted the repo-less-home-session-target branch July 2, 2026 01:23
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