Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: hostname not host:port; clarify GitHub-only review; cleanup test temp

Adam Eivyba5d7bb2f930
diff --git a/server/services/agentPromptBuilder.js b/server/services/agentPromptBuilder.js
index 42eea87039..eff0af1067 100644
--- a/server/services/agentPromptBuilder.js
+++ b/server/services/agentPromptBuilder.js
@@ -203,12 +203,14 @@ After completing your work and before committing, run \`/simplify\` to review th
// Build review loop section if enabled. The agent itself does NOT open the PR
// or run /do:rpr — by the time the PR exists, the agent has already exited.
- // The system requests Copilot review automatically after PR creation.
- // Only meaningful when a PR will actually be created (willOpenPR), since the
- // Copilot review request is a no-op without a PR URL.
+ // The system requests Copilot review automatically after PR creation on GitHub
+ // PRs. On non-GitHub forges (e.g. GitLab MRs) this step is skipped because the
+ // Copilot reviewer is GitHub-only. Only meaningful when a PR will actually be
+ // created (willOpenPR), since the Copilot review request is a no-op without a
+ // PR URL.
const reviewLoopSection = willReviewLoop && willOpenPR ? `
## Code Review
-After your task completes, the system will request a Copilot code review on the PR automatically. You do not need to open the PR or trigger the review yourself — focus on producing high-quality, well-tested code so the review pass goes cleanly.
+After your task completes, the system will request a Copilot code review automatically for GitHub PRs (the step is skipped for GitLab MRs and other non-GitHub forges). You do not need to open the PR or trigger the review yourself — focus on producing high-quality, well-tested code so the review pass goes cleanly.
` : '';
// Build JIRA context section if applicable
@@ -323,7 +325,7 @@ ${skillSection ? `## Task-Type Skill Guidelines\n\n${skillSection}\n` : ''}${too
- If blocked, explain clearly why
- Never update the PortOS changelog (\`.changelog/\`) for work on managed apps — the PortOS changelog tracks PortOS core changes only
- **BTW Messages**: The user may send you additional context while you work. Check for a \`BTW.md\` file in your working directory root — if it exists, read it for important messages from the user. Incorporate that context into your work. Do not delete or modify BTW.md.
-${isTruthyMetaFn(task.metadata?.readOnly) ? `- **This is a read-only task.** Do NOT commit, push, or modify any files in the repository. Only read data and generate reports.` : worktreeInfo && willOpenPR ? `- A pull request will be automatically created when your task completes — do NOT open a PR manually.${willReviewLoop ? ' A Copilot code review will also be requested automatically — do NOT run \`/do:rpr\` or attempt to address review comments yourself; you will have already exited.' : ''}` : worktreeInfo ? `- Your worktree branch will be automatically merged back to the source branch when your task completes — do NOT open a PR.` : ``}
+${isTruthyMetaFn(task.metadata?.readOnly) ? `- **This is a read-only task.** Do NOT commit, push, or modify any files in the repository. Only read data and generate reports.` : worktreeInfo && willOpenPR ? `- On successful completion, the system will push your branch and open a pull request — do NOT open a PR manually. (If the task fails, the worktree is preserved for debugging and no PR is opened.)${willReviewLoop ? ' For GitHub PRs, a Copilot code review will also be requested automatically (skipped on GitLab and other non-GitHub forges) — do NOT run \`/do:rpr\` or attempt to address review comments yourself; you will have already exited.' : ''}` : worktreeInfo ? `- Your worktree branch will be automatically merged back to the source branch when your task completes — do NOT open a PR.` : ``}
## Git Hygiene (CRITICAL)
- **Before starting work**, run \`git status\` to verify a clean working tree. Do NOT stash or discard uncommitted changes — other agents may be working concurrently and expecting those changes to be present. If the tree is dirty, only commit files YOU changed for this task.
diff --git a/server/services/git.js b/server/services/git.js
index 5ee692e8db..f0413529d8 100644
--- a/server/services/git.js
+++ b/server/services/git.js
@@ -496,7 +496,10 @@ export function parsePullRequestUrl(url) {
// request handlers, not URL validation helpers).
try { parsed = new URL(url); } catch { return null; }
- const host = parsed.host;
+ // Use hostname (no port) — `gh api --hostname` expects a bare hostname and
+ // chokes on host:port. We don't currently support custom-port forges, but if
+ // we ever do, the port should be plumbed through a separate field.
+ const host = parsed.hostname;
const segments = parsed.pathname.split('/').filter(Boolean);
// GitHub: /<owner>/<repo>/pull/<number>[/<more>]
diff --git a/server/services/git.test.js b/server/services/git.test.js
index a7874b0e5c..0e9c4c636e 100644
--- a/server/services/git.test.js
+++ b/server/services/git.test.js
@@ -185,16 +185,20 @@ describe('requestCopilotReview', () => {
// throwaway git repo with a gitlab.com remote — this exercises the real cli !== 'gh'
// skip path end-to-end without mocking. Without this, a nonexistent dir would fall
// back to cli: 'gh' and the test would silently pass even if the skip path broke.
- const { mkdtempSync } = await import('fs');
+ const { mkdtempSync, rmSync } = await import('fs');
const { tmpdir } = await import('os');
const { execSync } = await import('child_process');
const path = await import('path');
const repo = mkdtempSync(path.join(tmpdir(), 'portos-git-skip-'));
- execSync('git init -q', { cwd: repo });
- execSync('git remote add origin [email protected]:group/proj.git', { cwd: repo });
-
- const result = await requestCopilotReview(repo, 'https://gitlab.com/group/proj/-/merge_requests/1');
- expect(result).toEqual({ success: true, skipped: true });
+ try {
+ execSync('git init -q', { cwd: repo });
+ execSync('git remote add origin [email protected]:group/proj.git', { cwd: repo });
+
+ const result = await requestCopilotReview(repo, 'https://gitlab.com/group/proj/-/merge_requests/1');
+ expect(result).toEqual({ success: true, skipped: true });
+ } finally {
+ rmSync(repo, { recursive: true, force: true });
+ }
});
});