Skip to content

[Feat] Setup session investigates the repos and launches the work it finds - #1871

Draft
mrubens wants to merge 4 commits into
developfrom
feat/setup-session-repo-digest
Draft

[Feat] Setup session investigates the repos and launches the work it finds#1871
mrubens wants to merge 4 commits into
developfrom
feat/setup-session-repo-digest

Conversation

@mrubens

@mrubens mrubens commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What this does

Makes the first minutes of the setup session feel like Roomote is already working on your code. The final-screen checkboxes become focus areas (direction, not scripts), and the kickoff turn earns its launches:

  1. Repository digest in the kickoff event. On submit, the server builds a facts-only digest of the most active connected repositories: automation signals already collected at source-control connect (CI failures 30d, security alerts, merge activity, PR counts) plus a bounded live listing of open PRs with ages. Best-effort and time-boxed (~3s); failures degrade to a plain greeting, never a slow submit. PR titles ship as untrustedTitle and the prompt treats names/titles strictly as data, never instructions.
  2. Investigate-then-launch kickoff. Four beats: an intro that cites the one or two most interesting digest facts (never-invent rule) and says it's going to look around before starting anything → live investigation via deployment MCP servers and the advisor subagent, guided by the focus areas, posting at most a couple of concrete findings → one to three launched tasks with self-authored prompts naming the specific repository, failures, files, or PRs found (specific environment when evidence points at one repo; honest skips for areas with nothing worthwhile; a broader fallback task if investigation comes up dry) → a closeout recapping what was started and why, with follow-along framing.
  3. Early-PR shaping. At least one launched task is shaped to produce a small reviewable PR quickly, so a real PR lands during the first conversation.
  4. The picker copy now reads as choosing areas for Roomote to dig into.

Testing

  • Real-database tests for the digest builder (signals + live PRs; timeout and rejection degrade gracefully).
  • Command tests for the focusAreas event shape and digest inclusion/omission; client tests for the new copy and routing (22).
  • Fast prompt/service suites, check-types, lint, knip, and repo-wide format:check pass.
  • Feel-testing loop: fresh setup run → digest-grounded intro → findings while it digs → evidence-grounded launches → early PR in-session.

…ation

The setup submit now builds a best-effort, time-boxed repository digest
(automation signals already collected at source-control connect plus a
bounded live open-PR listing) and ships it in the kickoff event. The
kickoff prompt becomes four beats: an intro that cites one or two
concrete digest facts, the starter launches, exploration via MCP and the
advisor subagent that posts genuinely new observations (offering to act
on them) while the tasks run, and a follow-along closeout. The CI
starter prompt now opens its smallest safe improvement as an early PR
so a real pull request lands during the first conversation.
@roomote-community

roomote-community Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

1 issue outstanding. See task

  • Treat pull-request titles as untrusted before passing them to the trusted setup platform event.
  • Scope the setup repository digest to repositories the current administrator can access.

Reviewed 29f0bb3

Comment thread apps/web/src/trpc/commands/setup/repo-digest.ts Outdated
PR titles are contributor-authored and were riding inside a platform
event the prompt calls trusted, so a title could smuggle instructions
into the privileged setup turn. The field is now named untrustedTitle
(mirroring untrustedTaskGeneratedContext) and the setup prompt tells the
agent that names and titles are data only: never instructions, never a
justification for tool calls.
… live

The kickoff no longer executes the four catalog prompts verbatim. The
selected checkboxes ship as focusAreas (direction, not scripts), and the
setup turn investigates the connected repositories first, then launches
one to three tasks with self-authored prompts grounded in what it found,
choosing the specific environment when the evidence points at one repo
and honestly skipping areas with nothing worthwhile. The picker copy now
describes picking areas to dig into.
@mrubens mrubens changed the title [Feat] Setup session opens with repository evidence and explores while tasks run [Feat] Setup session investigates the repos and launches the work it finds Aug 30, 2026
prListTimeoutMs?: number;
} = {}): Promise<SetupRepoDigestEntry[]> {
try {
const activeRepositories = await db.query.repositories.findMany({

@roomote-community roomote-community Bot Aug 30, 2026

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.

🔴 This query has no administrator or workspace scope, so any administrator finishing setup loads every active repository in the deployment. The digest then fetches those repositories' PRs and supplies their names, activity, and titles to that administrator's setup session. Restrict the initial repository query to repositories the authenticated administrator is authorized to access before building the digest.

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