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: preserve enterprise hosts in claim evidence reads (#13226)

Adam Eivy3df14427afba
diff --git a/server/services/perpetualWork.js b/server/services/perpetualWork.js
index 1bd822c777..fc0f9fd771 100644
--- a/server/services/perpetualWork.js
+++ b/server/services/perpetualWork.js
@@ -169,7 +169,7 @@ async function inFlightIssueNumbers(repoPath, forge = 'github', env) {
// The branch list and the PR/MR list are independent CLI calls — run concurrently.
const prListCall = forge === 'gitlab'
? runCli('glab', withGlabJson(['mr', 'list', '--per-page', '100']), repoPath, env)
- : runCli('gh', githubClaimPrArgs(), repoPath, env);
+ : runCli('gh', await withGithubHost(githubClaimPrArgs(), repoPath), repoPath, env);
const [branchRes, prRes] = await Promise.all([
runCli('git', ['branch', '-a', '--no-color', '--format=%(refname:short)'], repoPath, env),
prListCall
diff --git a/server/services/perpetualWork.test.js b/server/services/perpetualWork.test.js
index 3ce97c25c1..856b1ea0d6 100644
--- a/server/services/perpetualWork.test.js
+++ b/server/services/perpetualWork.test.js
@@ -465,7 +465,7 @@ describe('perpetualWork', () => {
expect(out.skipCauses).toEqual({ 'excluded-label:in-flight': 1 });
});
- it('does not reclaim an issue assigned to the authenticated account', async () => {
+ it('preserves same-login assignment while querying the enterprise origin', async () => {
spawn.mockImplementation((cmd, args = []) => {
if (cmd === 'git' && args[0] === 'remote') return fakeChild('[email protected]:acme/widget.git\n');
if (cmd === 'gh' && args[0] === 'api' && args.includes('user')) return fakeChild('alice\n');
@@ -479,6 +479,8 @@ describe('perpetualWork', () => {
});
const out = await detectGithubIssues(app, { issueAuthorFilter: 'any' });
expect(out).toMatchObject({ actionable: false, count: 0, skipCauses: { assigned: 1 } });
+ const query = spawn.mock.calls.find(([cmd, args]) => cmd === 'gh' && args.includes('graphql'));
+ expect(query[1]).toEqual(expect.arrayContaining(['--hostname', 'ghe.example.com']));
});
it('does not need an identity probe to park an assigned-only GitHub queue', async () => {