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 ollama review: honest cache-staleness note, skip an unused resolve

[._.]/ Adam Eivy708c5e473e13
diff --git a/server/lib/slashdoLoader.js b/server/lib/slashdoLoader.js
index 1ebab5f237..a077a20df1 100644
--- a/server/lib/slashdoLoader.js
+++ b/server/lib/slashdoLoader.js
@@ -211,9 +211,15 @@ export async function loadSlashdoLib(libName, { teams = false } = {}) {
// Cache the MISS too. An install whose `lib/slashdo` submodule was never
// initialized (`npm run install:all` is what fetches it) would otherwise
// re-attempt the read on every spawn that asks — and since #3733 that is every
- // slashdo-free PR-opening agent, not just review-loop follow-ups. The
- // submodule can't appear without a restart, which is the same assumption the
- // hit path already makes.
+ // slashdo-free PR-opening agent, not just review-loop follow-ups.
+ //
+ // The cost of caching it: a user who runs `git submodule update --init` by
+ // hand against a RUNNING server keeps getting `null` until a restart, which
+ // now degrades those agents' Review Loop section rather than only follow-ups'.
+ // Accepted rather than papered over with an mtime probe — the recovery is a
+ // restart the user is already adjacent to, and re-statting a known-missing
+ // file on every spawn to catch it is the wrong trade. `clearSlashdoCaches()`
+ // is the hook to add if that ever stops being true.
if (!content) {
slashdoLibCache.set(cacheKey, null);
return null;
diff --git a/server/services/agentTuiSpawning.js b/server/services/agentTuiSpawning.js
index f1003d43d6..4c8cecb4dc 100644
--- a/server/services/agentTuiSpawning.js
+++ b/server/services/agentTuiSpawning.js
@@ -21,7 +21,7 @@ import { PATHS } from '../lib/fileUtils.js';
import { doneSentinelName, doneSentinelPath as resolveDoneSentinelPath, parseSentinelPayload } from '../lib/agentSentinel.js';
import { shouldAbandonForHostShutdown, HOST_SHUTDOWN_REASON } from '../lib/hostShutdown.js';
import { SENTINEL_COMPLETION_MARKER } from '../lib/agentOutputMarkers.js';
-import { prClaimWasVerified, resolvePrCompletion, resolvePrCreation } from '../lib/prDisposition.js';
+import { PR_CREATION, prClaimWasVerified, resolvePrCompletion, resolvePrCreation } from '../lib/prDisposition.js';
import { canTypeSlashCommands, agentOwnsPrWorkflow } from '../lib/slashdoInvocation.js';
import { PROVIDER_TYPES } from '../lib/aiToolkit/constants.js';
import { normalizeReviewers } from '../lib/validation.js';
@@ -1127,9 +1127,11 @@ export async function spawnTuiAgent({
// its own file and may still be running.
if (doneSentinelPath) await rm(doneSentinelPath).catch(() => {});
- // Resolved even when the agent owns the PR: cleanup's safety net may find
- // it never opened one, and the follow-up it then spawns needs these.
- const reviewOptions = cleanupSuccess && taskOpenPR
+ const prCreation = resolvePrCreation({ taskOpenPR, agentOwnsPr: agentOwnsPR, prClaimVerified });
+ // Only the two modes that can still open a PR (and thus spawn a follow-up
+ // that needs these) pay for the resolve. `never` — the dominant path, an
+ // agent that opened and landed its own PR — discards them.
+ const reviewOptions = prCreation !== PR_CREATION.NEVER
? await resolveReviewLoopOptions(task.metadata, { normalize: normalizeReviewers, isTruthyMeta: isTruthyMetaFn })
.catch(err => {
emitLog('warn', `TUI review options unavailable for ${agentId}: ${err.message}`, { agentId });
@@ -1137,7 +1139,7 @@ export async function spawnTuiAgent({
})
: {};
await cleanupWorktreeFn(agentId, cleanupSuccess, {
- prCreation: resolvePrCreation({ taskOpenPR, agentOwnsPr: agentOwnsPR, prClaimVerified }),
+ prCreation,
prCompletion: resolvePrCompletion(task.metadata),
...reviewOptions,
skipMerge: taskReviewLoopFollowUp || agentOwnsPR,