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

fix: make PR action provider configurable

[._.]/ Adam Eivyc6fb882ead53
diff --git a/client/src/components/cos/tabs/schedule/PipelineStageConfig.jsx b/client/src/components/cos/tabs/schedule/PipelineStageConfig.jsx
index bb2c132758..f592a51717 100644
--- a/client/src/components/cos/tabs/schedule/PipelineStageConfig.jsx
+++ b/client/src/components/cos/tabs/schedule/PipelineStageConfig.jsx
@@ -91,7 +91,7 @@ export default function PipelineStageConfig({ taskType, config, providers, onUpd
<div>
<p className="text-sm font-medium text-white">Run final code review and actions</p>
<p className="text-xs text-gray-400 mt-1">
- When enabled, an isolated Codex reviewer applies only the screened patch, runs local tests, and returns a structured review for the deterministic GitHub coordinator. It is nested here, not a separate scheduled task.
+ When enabled, a configured sandbox-capable reviewer applies only the screened patch, runs local tests, and returns a structured review for the deterministic GitHub coordinator. It is nested here, not a separate scheduled task.
</p>
</div>
<ToggleSwitch
@@ -179,7 +179,7 @@ export default function PipelineStageConfig({ taskType, config, providers, onUpd
onEffortChange={(effort) => updateStage('effort', effort)}
emptyProviderOption={isEligibilityStage
? 'Select enforced local review provider (required)'
- : isActionsStage ? 'Select sandboxed Codex CLI (required)' : 'Default (task-level)'}
+ : isActionsStage ? 'Select sandbox-capable CLI (required)' : 'Default (task-level)'}
emptyModelOption={isEligibilityStage
? 'Select installed no-tool model (required)'
: isActionsStage ? 'Use provider default model' : 'Default (task-level)'}
@@ -197,7 +197,7 @@ export default function PipelineStageConfig({ taskType, config, providers, onUpd
)}
{isActionsStage && (
<p className="text-xs text-gray-500 mt-2">
- Final review accepts only the direct Codex CLI provider. PortOS launches it with a workspace-write sandbox, ephemeral config, and no GitHub/forge credentials; the deterministic coordinator owns comments, issue filing, CI triggers, and merges.
+ Final review accepts only a configured direct CLI with a maintained sandbox (for example, Codex or Antigravity). PortOS passes the selected provider, model, and thinking effort through that provider&apos;s safe recipe, with no explicit GitHub/forge credential or configuration overlays; the deterministic coordinator owns comments, issue filing, CI triggers, and merges.
</p>
)}
</div>
diff --git a/client/src/components/cos/tabs/schedule/PipelineStageConfig.test.jsx b/client/src/components/cos/tabs/schedule/PipelineStageConfig.test.jsx
index cf8d46015b..7844f174c3 100644
--- a/client/src/components/cos/tabs/schedule/PipelineStageConfig.test.jsx
+++ b/client/src/components/cos/tabs/schedule/PipelineStageConfig.test.jsx
@@ -61,6 +61,14 @@ const providers = [
publicReviewActionsSupported: true,
models: ['gpt-5.6'],
},
+ {
+ id: 'antigravity-cli',
+ name: 'Antigravity CLI',
+ type: 'cli',
+ command: 'agy',
+ publicReviewActionsSupported: true,
+ models: ['gemini-3.6-flash'],
+ },
{
id: 'other-cli',
name: 'Other CLI',
@@ -87,17 +95,17 @@ function renderStages(stages = STAGES, onUpdate = vi.fn().mockResolvedValue(unde
}
describe('PipelineStageConfig — pr-reviewer', () => {
- it('uses the shared no-tool policy for the gate and the Codex-only policy for actions', () => {
+ it('uses shared capability policies for the gate and sandbox-capable action providers', () => {
renderStages();
const providerSelects = screen.getAllByLabelText('Provider');
expect([...providerSelects[0].options].map((option) => option.value)).toEqual(['', 'claude-ollama']);
- expect([...providerSelects[1].options].map((option) => option.value)).toEqual(['', 'codex-cli']);
+ expect([...providerSelects[1].options].map((option) => option.value)).toEqual(['', 'codex-cli', 'antigravity-cli']);
const modelSelects = screen.getAllByLabelText('Model');
expect([...modelSelects[0].options].map((option) => option.value)).toEqual(['', 'safe-model']);
expect([...modelSelects[1].options].map((option) => option.value)).toEqual(['', 'gpt-5.6']);
- expect(screen.getByText(/workspace-write sandbox/i)).toBeInTheDocument();
+ expect(screen.getByText(/maintained sandbox/i)).toBeInTheDocument();
});
it('removes the optional actions stage without changing the mandatory gate', async () => {
diff --git a/server/lib/agentExecutionProfiles.js b/server/lib/agentExecutionProfiles.js
index 3057d3a05d..9cbb2035dd 100644
--- a/server/lib/agentExecutionProfiles.js
+++ b/server/lib/agentExecutionProfiles.js
@@ -8,8 +8,8 @@ export const PUBLIC_REVIEW_EXECUTION_PROFILE = 'public-review';
// The public-review pipeline has three deliberately different trust postures:
// the security scan is a server-side classifier, the eligibility gate is a
-// tool-free reasoner, and the final review is a direct Codex CLI inside a
-// disposable workspace-write sandbox. Keep the profile names here so every
+// tool-free reasoner, and the final review is a configured direct CLI inside a
+// provider-specific maintained sandbox. Keep the profile names here so every
// spawn path agrees on which posture is enforced instead of comparing stage
// names or task types.
export const PUBLIC_REVIEW_GATE_EXECUTION_PROFILE = 'public-review-gate';
diff --git a/server/lib/providerVendors.js b/server/lib/providerVendors.js
index 58989b5fc9..aec1d4f40a 100644
--- a/server/lib/providerVendors.js
+++ b/server/lib/providerVendors.js
@@ -159,11 +159,10 @@ function codexSpawnArgs(provider, { effectiveModel, effort, maxConcurrentThreads
}
function codexPublicReviewActionsSpawnArgs(provider, { effectiveModel, effort, maxConcurrentThreads }) {
- // This is the only action-stage recipe. `workspace-write` is intentionally
- // the narrowest Codex sandbox that can apply a supplied patch and run local
- // tests; `--approve-for-me` only suppresses interactive confirmations inside
- // that sandbox. Never replace these with the unrestricted bypass used by the
- // ordinary coding-agent path.
+ // `workspace-write` is intentionally the narrowest Codex sandbox that can
+ // apply a supplied patch and run local tests; `--approve-for-me` only
+ // suppresses interactive confirmations inside that sandbox. Never replace
+ // these with the unrestricted bypass used by the ordinary coding-agent path.
const args = [
'exec',
'--sandbox', 'workspace-write',
@@ -180,6 +179,23 @@ function codexPublicReviewActionsSpawnArgs(provider, { effectiveModel, effort, m
return { command: provider?.command || CODEX_COMMAND, args, stdinMode: 'prompt' };
}
+function antigravityPublicReviewActionsSpawnArgs(provider, { effectiveModel, effort }) {
+ // Antigravity's explicit terminal sandbox is the maintained action posture for
+ // this vendor. `accept-edits` permits the reviewer to apply the screened patch
+ // and run tests without granting the unrestricted permission bypass used by
+ // ordinary coding tasks. Provider args are intentionally not copied here:
+ // saved args could turn a safe profile back into an unrestricted session.
+ const args = [
+ '--sandbox',
+ '--mode', 'accept-edits',
+ '--disable-slash-commands',
+ '--print',
+ ];
+ if (effectiveModel) args.push('--model', effectiveModel);
+ args.push(...buildEffortArgs(effort, provider, args, effectiveModel));
+ return { command: provider?.command || ANTIGRAVITY_COMMAND, args, stdinMode: 'prompt' };
+}
+
const CODEX = {
id: 'codex',
idFragment: 'codex',
@@ -190,6 +206,7 @@ const CODEX = {
cliArgs: codexCliArgs,
spawnArgs: codexSpawnArgs,
publicReviewActionsSpawnArgs: codexPublicReviewActionsSpawnArgs,
+ publicReviewActionsProvider: (provider) => provider?.type === 'cli' && isCodexCommand(provider?.command),
};
// ─── antigravity ────────────────────────────────────────────────────────────
@@ -210,6 +227,8 @@ const ANTIGRAVITY = {
cliArgs: antigravityCliArgs,
preparePrompt: prepareAntigravityPrompt,
spawnArgs: defaultSpawnArgs(antigravityCliArgs, ANTIGRAVITY_COMMAND),
+ publicReviewActionsSpawnArgs: antigravityPublicReviewActionsSpawnArgs,
+ publicReviewActionsProvider: (provider) => provider?.type === 'cli' && isAntigravityCommand(provider?.command),
};
// ─── opencode ───────────────────────────────────────────────────────────────
@@ -478,7 +497,7 @@ export function inferTuiCommand(id) {
/** `applyCommandDefaults` (tuiHandshake.js): TUI posture-flag dispatch. */
export function applyCommandDefaults(command, args, { safetyProfile = null } = {}) {
if (safetyProfile === PUBLIC_REVIEW_ACTIONS_EXECUTION_PROFILE) {
- throw new Error('The public-review-actions profile requires the direct Codex CLI sandbox');
+ throw new Error('The public-review-actions profile requires a supported direct CLI sandbox');
}
const vendor = PROVIDER_VENDORS.find((v) => (
(isPublicReviewNoToolProfile(safetyProfile) ? v.publicReviewTuiArgs : v.tuiArgs)
@@ -544,9 +563,8 @@ export function buildVendorSpawnConfig(provider, ctx) {
}
function matchesPublicReviewActionsProvider(vendor, provider) {
- return vendor.id === 'codex'
- && provider?.type === 'cli'
- && isCodexCommand(provider?.command);
+ return typeof vendor.publicReviewActionsProvider === 'function'
+ && vendor.publicReviewActionsProvider(provider);
}
/**
@@ -567,9 +585,9 @@ export function supportsPublicReviewProvider(provider, { tui = false } = {}) {
}
/**
- * Whether a provider can run the final public-review stage. This is a direct
- * Codex CLI only: the action stage needs a filesystem sandbox, while TUI/API
- * transports do not expose the maintained non-interactive posture here.
+ * Whether a provider can run the final public-review stage. This is restricted
+ * to direct CLI vendors with an explicit maintained filesystem/terminal sandbox
+ * recipe; TUI/API transports and arbitrary custom commands fail closed.
*/
export function supportsPublicReviewActionsProvider(provider, { tui = false } = {}) {
if (tui || provider?.type !== 'cli') return false;
diff --git a/server/lib/providerVendors.publicReview.test.js b/server/lib/providerVendors.publicReview.test.js
index 6b7bf9dd37..c7429d29ba 100644
--- a/server/lib/providerVendors.publicReview.test.js
+++ b/server/lib/providerVendors.publicReview.test.js
@@ -34,7 +34,7 @@ describe('public-review provider profile', () => {
})).toBe(false);
});
- it('supports only a direct Codex CLI for the sandboxed actions stage', () => {
+ it('supports direct CLI providers with maintained action sandboxes', () => {
const codex = {
id: 'codex-cli',
type: 'cli',
@@ -45,6 +45,17 @@ describe('public-review provider profile', () => {
expect(supportsPublicReviewActionsProvider({ ...codex, type: 'tui' })).toBe(false);
expect(supportsPublicReviewActionsProvider({ ...codex, type: 'api' })).toBe(false);
expect(supportsPublicReviewActionsProvider({ ...codex, command: 'other-agent' })).toBe(false);
+
+ const antigravity = {
+ id: 'antigravity-cli',
+ type: 'cli',
+ command: 'agy',
+ models: ['gemini-3.6-flash-high'],
+ };
+ expect(supportsPublicReviewActionsProvider(antigravity)).toBe(true);
+ expect(supportsPublicReviewActionsProvider({ ...antigravity, type: 'tui' })).toBe(false);
+ expect(supportsPublicReviewActionsProvider({ ...antigravity, type: 'api' })).toBe(false);
+ expect(supportsPublicReviewActionsProvider({ ...antigravity, command: 'other-agent' })).toBe(false);
});
it('builds the final reviewer with the bounded Codex sandbox and no provider args', () => {
@@ -68,7 +79,28 @@ describe('public-review provider profile', () => {
expect(config.args).not.toContain('unsafe.json');
});
- it('rejects the action profile for every non-Codex provider', () => {
+ it('builds the final reviewer with the bounded Antigravity sandbox and selected effort', () => {
+ const config = buildVendorSpawnConfig({
+ id: 'antigravity-cli',
+ type: 'cli',
+ command: '/opt/example/bin/agy',
+ args: ['--dangerously-skip-permissions', '--model', 'unsafe-model'],
+ models: ['gemini-3.6-flash-low', 'gemini-3.6-flash-high'],
+ }, {
+ effectiveModel: 'gemini-3.6-flash',
+ effort: 'high',
+ safetyProfile: PUBLIC_REVIEW_ACTIONS_EXECUTION_PROFILE,
+ });
+
+ expect(config.args).toEqual(expect.arrayContaining([
+ '--sandbox', '--mode', 'accept-edits', '--disable-slash-commands',
+ '--model', 'gemini-3.6-flash', '--effort', 'high',
+ ]));
+ expect(config.args).not.toContain('--dangerously-skip-permissions');
+ expect(config.args).not.toContain('unsafe-model');
+ });
+
+ it('rejects the action profile for every provider without a maintained sandbox', () => {
expect(() => buildVendorSpawnConfig(localClaude, {
effectiveModel: 'safe-model',
safetyProfile: PUBLIC_REVIEW_ACTIONS_EXECUTION_PROFILE,
diff --git a/server/services/agentLifecycle.js b/server/services/agentLifecycle.js
index 89bde5a3d0..83174c156f 100644
--- a/server/services/agentLifecycle.js
+++ b/server/services/agentLifecycle.js
@@ -512,8 +512,8 @@ async function runAgentSpawn(task) {
}
// Every public-content stage is direct-only. The CoS runner is a shared
// process and may inherit ambient tool configuration; the final stage's
- // direct Codex recipe is what enforces its workspace sandbox. GitHub
- // mutations still belong to the deterministic output hook.
+ // provider-specific direct CLI recipe is what enforces its sandbox.
+ // GitHub mutations still belong to the deterministic output hook.
const dispatchUseRunner = publicReview ? false : useRunner;
let publicReviewPromptData = null;
diff --git a/server/services/agentWorkspacePrep.js b/server/services/agentWorkspacePrep.js
index 8aa76714c8..31f7c0346d 100644
--- a/server/services/agentWorkspacePrep.js
+++ b/server/services/agentWorkspacePrep.js
@@ -467,9 +467,9 @@ export async function prepareAgentWorkspace({ agentId, task }) {
} // end !isReadOnly
// A read-only public-review stage still needs a disposable checkout: it may
- // run repository commands and the action stage uses workspace-write for
- // tests/patch inspection. Never let `readOnly` turn an explicit isolation
- // request into the live application checkout.
+ // run repository commands and the action stage's provider-specific sandbox
+ // needs it for tests/patch inspection. Never let `readOnly` turn an explicit
+ // isolation request into the live application checkout.
if (wantsWorktree && !jiraBranchName) {
const worktreeOutcome = await prepareRequestedWorktree({
agentId,
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 765f48aac9..63fde5d661 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -41,7 +41,7 @@
"pr-reviewer": "679680b3b382aeb6786df01c4d1a90c6",
"pr-reviewer-security": "a993798467b8d773b0e44b3e3d303bd0",
"pr-reviewer-eligibility": "7e35acefd33f05145544e2702d065bfd",
- "pr-reviewer-review": "97ac802c648a4cea2a6f6bf3f24d8845",
+ "pr-reviewer-review": "76d1d8265d4d56ae6a4c00d64e8787a8",
"reference-watch": "e0e20754700fb08d5159b8437d9c260b",
"pr-watcher": "53ead8e26d396849bfa78f28550bd691",
"refresh-local-llm-catalog": "9741ca6a8419fcdea2743e3b64781a8b"
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index 1a5d9adbe4..c2cbe7c7bc 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -2361,10 +2361,11 @@ instruction.
Repository: {repoPath}
-This stage runs as a direct Codex CLI child inside a disposable
-\`workspace-write\` sandbox. It may inspect the repository, apply the supplied
-patches, and run relevant local tests. It has no GitHub/forge credentials or
-tools and must not use network access. It MUST NOT run \`gh\`, \`glab\`, SSH,
+This stage runs as a configured direct CLI child inside its provider's
+maintained sandbox and a disposable worktree. It may inspect the repository,
+apply the supplied patches, and run relevant local tests. It has no explicit
+GitHub/forge credential or configuration overlays and must not use network
+access. It MUST NOT run \`gh\`, \`glab\`, SSH,
package downloads, remote fetches, or any command that changes state outside
the disposable worktree. It must not commit, push, post a review/comment,
approve, rebase online, file an issue, trigger CI, or merge. The deterministic