Repository navigation
fix(bot): resolve GitLab projects through the account connection - #7874
Merged
Merged
Conversation
The Cloud Agent tool now resolves a requested GitLab project through the account's GitLab connection before it prepares the session, the same way its GitHub branch resolves the repository. A project that the connection does not cover answers with an error and prepares no session. A lookup that cannot complete fails closed with a retryable message instead of an authorization verdict.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe bot's Cloud Agent tool now resolves GitLab projects through the account connection before preparing a session; the added validation, error handling, and tests are consistent with the existing GitHub path and I found no defects in the changed code. Files Reviewed (2 files)
Reviewed by deepseek-v4.1-flash · Input: 44.3K · Output: 5.4K · Cached: 336.5K Review guidance: REVIEW.md from base branch |
iscekic
enabled auto-merge
October 19, 2026 17:48
iscekic
disabled auto-merge
October 22, 2026 18:57
eshurakov
approved these changes
Oct 26, 2026
eshurakov
left a comment
Contributor
There was a problem hiding this comment.
Shallow review: no critical issues found.
This was referenced Oct 27, 2026
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.
Evidence
Evidence: demonstrated — a local end-to-end run delivered signed GitHub chat webhooks into the running app, which executed the real bot agent loop and tool against Postgres, the GitLab credential broker and the Cloud Agent client; each scenario's tool result, prepared-session payload and provider read was observed.
Change
The bot's Cloud Agent tool resolves a requested GitLab project through the account's GitLab connection before it prepares a session, matching how its GitHub branch resolves a repository. Organization connections resolve through the acting bot user; personal connections resolve through their owner. The tool answers with its error and prepares no session unless the requested project is in the connection's project set. A lookup that cannot complete answers with a retryable message. Lookup failures are reported to Sentry under the tool's operation tag.
This pull request is bot-tool-scoped. The sibling router path is tracked separately; web, mobile and CLI behavior is outside this pull request.
Verification
End-to-end run on the work VM at head
a357422. Real Next.js dev server, real Postgres, real/api/webhooks/githubroute, real bot agent loop with real tool execution, real GitLab integration helpers. The chat platform, the GitLab API, the GitLab credential broker and the Cloud Agent API were served by one local recorder at the network boundary.Four signed
issue_commentwebhooks, one per scenario; each checked against the app'sbot_requestsrow and the recorder's request log:GET /api/v4/projects, snapshot persistedGET /api/v4/projectsrefused12 of 12 checks passed. The GitHub thread received the bot reply in the refused and retry cases.
Also at this head:
pnpm --filter web test -- spawn-cloud-agent-session— 10 passed.Not exercised: a live GitLab account, a real chat workspace and a real worker clone. This is a nonvisual change; no screenshot is provided.
Production prerequisites
None.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Bot tool only.
Confidence: 0.62 · Precedent: The least work without a drop in quality; close a related gap if the session finds one.
Answer: Fail closed with a retry message.
Confidence: 0.75 · Precedent: Keep the file's error-string convention and do not report a transient outage as a permanent verdict.
Answer: Keep this pull request scoped to the bot tool. Handle the router path in a separate pull request with tests and end-to-end proof, written in neutral text.
Confidence: 0.55 · Precedent: Fix the class on every affected surface, with each concern in its own pull request.
Answer: Temporarily use the judge credential.
Confidence: 0.78 · Precedent: Approve narrowly scoped operational recovery; do not accept blocked as an end state.