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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: add agentic managed app pull request action
[._.]/ Adam Eivy9b73b1836e9c
diff --git a/client/src/components/apps/tabs/GitTab.jsx b/client/src/components/apps/tabs/GitTab.jsxindex d6aa68f570..b438e76056 100644--- a/client/src/components/apps/tabs/GitTab.jsx+++ b/client/src/components/apps/tabs/GitTab.jsx@@ -147,6 +147,7 @@ export default function GitTab({ appId, appName, repoPath }) {const [pushing, setPushing] = useState(null);const [syncing, setSyncing] = useState(null);const [pushingAll, setPushingAll] = useState(false);+ const [openingPullRequest, setOpeningPullRequest] = useState(false);const [remoteBranches, setRemoteBranches] = useState([]);const [_defaultBranch, setDefaultBranch] = useState('main');const [loadingRemote, setLoadingRemote] = useState(false);@@ -333,6 +334,23 @@ export default function GitTab({ appId, appName, repoPath }) {await loadGitInfo();};+ const handleOpenPullRequest = async () => {+ if (!appId || !repoPath || openingPullRequest) return;+ setOpeningPullRequest(true);+ const result = await api.createSlashdoTask('push', appId, {+ prCompletion: 'review-then-merge',+ overrideContext: 'Work on the managed app repository. Reconcile all current work before delivery: include uncommitted changes, local commits not merged into the default branch, and commits not yet pushed. Preserve the app\'s existing intent, create or update a pull request against the default branch, then run the configured review process and merge it when review and CI are green. Do not discard work or push directly to the protected default branch.',+ }, { silent: true }).catch((err) => {+ toast.error(`Could not queue pull request agent: ${err.message}`);+ return null;+ });+ setOpeningPullRequest(false);+ if (result) {+ toast.success(`Pull request agent queued for ${appName} — check CoS Agents`);+ await api.forceCosEvaluate().catch(() => null);+ }+ };+const handleDeleteBranch = async (branchName, { local, remote }) => {if (!repoPath || deleting) return;setDeleting(branchName);@@ -533,6 +551,15 @@ export default function GitTab({ appId, appName, repoPath }) {{pushingAll ? 'Pushing...' : 'Push'}</button>)}+ <button+ onClick={handleOpenPullRequest}+ disabled={openingPullRequest || !gitInfo?.isRepo}+ title="Have an agent commit, push, review, and merge the current repository work through a pull request"+ className="flex items-center gap-1.5 px-3 py-2 bg-port-accent/20 border border-port-accent/40 rounded-lg text-sm text-port-accent hover:bg-port-accent/30 disabled:opacity-50"+ >+ <Rocket size={16} className={openingPullRequest ? 'animate-pulse' : ''} />+ {openingPullRequest ? 'Queuing PR agent...' : 'Open PR with agent'}+ </button><buttononClick={handleUpdateBranches}disabled={updating}diff --git a/client/src/components/apps/tabs/GitTab.test.jsx b/client/src/components/apps/tabs/GitTab.test.jsxindex d512980815..da63558f43 100644--- a/client/src/components/apps/tabs/GitTab.test.jsx+++ b/client/src/components/apps/tabs/GitTab.test.jsx@@ -11,6 +11,8 @@ vi.mock('../../../services/api', () => ({getGitDiff: vi.fn(),cleanupMergedBranches: vi.fn(),resetToDefaultBranch: vi.fn(),+ createSlashdoTask: vi.fn(),+ forceCosEvaluate: vi.fn(),}));vi.mock('./RepositorySourcePanel', () => ({default: ({ appId, refreshKey }) => (@@ -45,6 +47,8 @@ beforeEach(() => {api.getGitDiff.mockResolvedValue({ diff: '@@ -1 +1 @@\n-old\n+new' });api.cleanupMergedBranches.mockResolvedValue({ deleted: [], skipped: [] });api.resetToDefaultBranch.mockResolvedValue({ success: true, branch: 'main', previousBranch: 'main', previousHead: 'b'.repeat(40), head: 'a'.repeat(40), discardedFiles: 1, fetched: true });+ api.createSlashdoTask.mockResolvedValue({ id: 'task-pr-1' });+ api.forceCosEvaluate.mockResolvedValue({ success: true });});afterEach(() => {@@ -53,6 +57,22 @@ afterEach(() => {});describe('GitTab managed repository sources', () => {+ it('queues an agent to deliver current work through a reviewed pull request', async () => {+ render(<GitTab appId="app-example" appName="Example App" repoPath="/repo" />);++ fireEvent.click(await screen.findByRole('button', { name: 'Open PR with agent' }));++ await waitFor(() => expect(api.createSlashdoTask).toHaveBeenCalledWith(+ 'push',+ 'app-example',+ expect.objectContaining({+ prCompletion: 'review-then-merge',+ overrideContext: expect.stringContaining('uncommitted changes'),+ }),+ { silent: true },+ ));+ });+it('shows repository topology for every managed app', async () => {const { rerender } = render(<GitTab