Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
Server — git actions / source control (GitLab provider)
Steps to reproduce
- Linux (here: WSL2 Ubuntu) with
glabinstalled from the Snap Store (snap install glab, strict confinement), authenticated and working (glab mr listsucceeds). - Open a GitLab-hosted project in T3 Code, push a branch.
- Press the git action button with Create MR (
create_pr) or Commit, push & create MR (commit_push_pr).
Minimal repro without T3 Code, same command shape T3 Code uses:
echo test > /tmp/body.md
glab api --method GET projects/:fullpath --field description=@/tmp/body.md
# ERROR error parsing "description" value: open /tmp/body.md: no such file or directory.
echo test > ~/body.md
glab api --method GET projects/:fullpath --field description=@$HOME/body.md
# 200 OKExpected behavior
The merge request is created, as it is when the same branch's MR is created with glab mr create --description "..." from a shell.
Actual behavior
The action fails with:
Source control provider gitlab failed in createChangeRequest: GitLab CLI command failed.
Root cause:
runPrStep(apps/server/src/git/GitManager.ts) always writes the generated body to$TMPDIR ?? $TEMP ?? $TMP ?? "/tmp"ast3code-pr-body-<pid>-<uuid>.md.GitLabCli.createMergeRequest(packages/source-control-gitlab/src/server/GitLabCli.ts) passes it asglab api --method POST projects/:fullpath/merge_requests ... --field description=@<bodyFile>.- Strictly confined snaps get a private
/tmp(/tmp/snap-private-tmp/snap.glab/tmp), so glab cannot open the host's/tmp/t3code-pr-body-*.mdand exits 1. glab's snap does have thehomeplug, so a file under$HOMEworks.
This has been the behavior since GitLab support landed (0ce7e56e43, description=@${input.bodyFile}) and is unchanged on main (e136e8e3d4).
Read-only glab calls (mr list, mr view, api projects/:fullpath) work, so the provider looks healthy right up until creation fails.
Secondary issue: the surfaced error drops glab's stderr. The UI only says "GitLab CLI command failed.", and the server trace only has exited with 1 - Process exited with a non-zero status., so the real cause (open /tmp/...: no such file or directory) is not visible anywhere.
Suggested fix
Any of these would work:
- Pass the description without a file. The smallest change is
--field description=@-with the body written to the child's stdin, since glab reads@-from standard input.--input -(raw JSON body over stdin) would also work. - Write the body file somewhere snaps can read, such as a directory under the T3 data dir in
$HOME, instead ofos.tmpdir(). - At minimum, include the CLI's stderr in
GitLabCliCommandErrorso users can see why it failed.
The GitHub path (gh pr create --body-file) probably has the same problem when gh is installed as a snap, although gh is usually installed from apt.
Impact
Major for affected setups: creating an MR from the git action button never works with snap-installed glab, which is the default glab install on Ubuntu. No workaround inside T3 Code. The user has to create MRs from a shell or install glab another way.
Version or commit
Server 0.1.7 (WSL runtime sha256-c089892b…, also reproduced on the previous runtime sha256-7cf31da9…). Matching code on main @ e136e8e3d4.
Environment
- Windows 11 desktop app "T3 Code (Beta)", backend running in WSL2 (Ubuntu), kernel
6.18.33.2-microsoft-standard-WSL2 - glab
1.128.0(snap rev 7114,confinement: strict, plugs:home, …). Also strict in the previous rev 6906 (1.123.0). - T3 server process environment has no
TMPDIR, so the body file goes to/tmp.
Logs or stack traces
GitLabCli.createMergeRequest Failure
GitLabCliCommandError: GitLab CLI failed in execute: GitLab CLI command failed.
VcsProcess.runUnbounded Failure
VcsProcessExitError: VCS process failed in GitLabCli.execute: glab (<worktree>) exited with 1 - Process exited with a non-zero status.
GitLabSourceControlProvider.createChangeRequest Failure
SourceControlProviderError: Source control provider gitlab failed in createChangeRequest: GitLab CLI command failed.
Activity