[Fix] Honor database-configured GitHub App slugs in cloud-agents and onboarding - #117
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
#115 made the bot-identity checks in
packages/githubhonor a database-configured GitHub App slug viaresolveConfiguredGitHubAppSlug()/getEffectiveGitHubAppSlug(), butpackages/cloud-agentsstill read the slug from process env only. Deployments whose app slug lives only in the encryptedenvironment_variablestable (the/setupmanifest 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, andisRoomoteGitHubLoginfell back to process env because nothing in the worker ever populated the cache.Changes
workflows/utils.ts:getPrBodyAttributionLine's default slug andisRoomoteIssueCommentAuthor's slug set now derive fromgetEffectiveGitHubAppSlug()instead ofEnv.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) awaitsresolveConfiguredGitHubAppSlug()before dispatching, so the synchronous helpers (includingisRoomoteGitHubLoginingithubPrReview) 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:routeGitHubTaskrefreshes the slug before building the routing prompt.onboarding.statusnow returns a server-resolvedgithubAppSlug, andStepGitHubrenders it instead of the client-inlinedprocess.env.NEXT_PUBLIC_GITHUB_APP_SLUG(which is wrong for DB-configured deployments); the build-time value remains the fallback.Tests
utilsAppSlug.test.tscovers review-summary reuse and attribution mentions with and without a cached configured slug, mirroringresolve-app-slug.test.ts's use ofsetConfiguredGitHubAppSlugCache.github-routing-prompt.test.tsgains a database-configured-slug case.@roomote/cloud-agentssuite, web onboarding tests,check-typesfor both packages, ESLint, and Prettier all pass.pnpm knipoutput is byte-identical to develop's pre-existing failures (verified against a stashed baseline), which are being handled separately.