Skip to content

[Fix] Honor database-configured GitHub App slugs in cloud-agents and onboarding - #117

Merged
mrubens merged 2 commits into
developfrom
claude/quizzical-robinson-92062e
Jul 10, 2026
Merged

[Fix] Honor database-configured GitHub App slugs in cloud-agents and onboarding#117
mrubens merged 2 commits into
developfrom
claude/quizzical-robinson-92062e

Conversation

@mrubens

@mrubens mrubens commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Context

#115 made the bot-identity checks in packages/github honor a database-configured GitHub App slug via resolveConfiguredGitHubAppSlug() / getEffectiveGitHubAppSlug(), but packages/cloud-agents still read the slug from process env only. Deployments whose app slug lives only in the encrypted environment_variables table (the /setup manifest flow, e.g. the nightly openmote instance) were still misclassified there: review-summary comment reuse, PR attribution mentions, and the GitHub routing prompt all used the wrong bot handle, and isRoomoteGitHubLogin fell back to process env because nothing in the worker ever populated the cache.

Changes

  • workflows/utils.ts: getPrBodyAttributionLine's default slug and isRoomoteIssueCommentAuthor's slug set now derive from getEffectiveGitHubAppSlug() instead of Env.NEXT_PUBLIC_GITHUB_APP_SLUG.
  • router/prompts/github-routing-prompt.ts: the routing prompt embeds the effective bot handle.
  • cloud-agent-workflow.ts: generatePrompt (the worker's workflow entry point) awaits resolveConfiguredGitHubAppSlug() before dispatching, so the synchronous helpers (including isRoomoteGitHubLogin in githubPrReview) classify against the configured slug. Mirrors the webhook-entry refresh from [Fix] Recognize database-configured GitHub App slugs in bot-identity checks #115.
  • router/router-service.ts: routeGitHubTask refreshes the slug before building the routing prompt.
  • Onboarding: onboarding.status now returns a server-resolved githubAppSlug, and StepGitHub renders it instead of the client-inlined process.env.NEXT_PUBLIC_GITHUB_APP_SLUG (which is wrong for DB-configured deployments); the build-time value remains the fallback.

Tests

  • New utilsAppSlug.test.ts covers review-summary reuse and attribution mentions with and without a cached configured slug, mirroring resolve-app-slug.test.ts's use of setConfiguredGitHubAppSlugCache.
  • github-routing-prompt.test.ts gains a database-configured-slug case.
  • Full @roomote/cloud-agents suite, web onboarding tests, check-types for both packages, ESLint, and Prettier all pass. pnpm knip output is byte-identical to develop's pre-existing failures (verified against a stashed baseline), which are being handled separately.

…onboarding

PR #115 made the bot-identity helpers in packages/github cache-aware, but
packages/cloud-agents still read the app slug from process env only, so
deployments whose slug lives in the encrypted environment_variables table
(the /setup manifest flow) were misclassified there.

- getPrBodyAttributionLine and isRoomoteIssueCommentAuthor now derive the
  slug from getEffectiveGitHubAppSlug()
- buildGitHubRoutingPrompt embeds the effective bot handle
- generatePrompt (worker workflow entry) and routeGitHubTask await
  resolveConfiguredGitHubAppSlug() before any synchronous classification,
  mirroring the PR #115 webhook-entry pattern
- onboarding StepGitHub renders a server-resolved slug from the
  onboarding.status tRPC query instead of the build-time env value


The gitlabMrReview tests mock @roomote/github without the
getEffectiveGitHubAppSlug/resolveConfiguredGitHubAppSlug exports added in
#115, so the workflow's attribution helpers hit the vitest missing-export
guard. The OpenCode packaging test still asserted control-plane images carry
no OpenCode CLI, but #114 deliberately layered it into the shared
runtime-inference-base stage for in-process non-task inference; the test now
asserts the version is pinned in lockstep with the worker and that the
install stays confined to that stage.
@mrubens
mrubens merged commit e2e5318 into develop Jul 10, 2026
@mrubens
mrubens deleted the claude/quizzical-robinson-92062e branch July 10, 2026 19:45
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