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: fail blocked Antigravity agents promptly

[._.]/ Adam Eivy3be4dfa57f2e
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 0868591d40..2936b06b76 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -34,6 +34,7 @@
## CoS agent failure reporting
+- An Antigravity agent no longer waits for the idle timeout when its Google account is still being verified. That provider screen is recognized immediately, the task records an actionable provider failure, and CoS can use its configured fallback instead of presenting a session that looks stuck.
- A reference-watch run against a GitHub/GitLab/JIRA work tracker is no longer failed for leaving a clean worktree. Those runs file issues instead of editing application code, so "no file changes" is what success looks like — a task can now declare that its work product isn't files, and only that check is relaxed (a run that never actually started still fails).
- Failed agent runs are classified far more accurately. A terminal-UI agent's transcript is a repainted *screen*, not a log — it can run to hundreds of kilobytes while containing barely any line breaks — so the analyzer's "look at the recent output" window was quietly reading the entire session. Any keyword anywhere in it, including commands the agent itself typed, decided the verdict: one run reaped for going idle was reported as "Context length exceeded", which blocked its task and auto-filed an investigation for a problem that never happened.
- When the system already knows why a run ended — the idle watchdog fired, the runtime budget ran out, the provider CLI wasn't installed — that is now what gets reported. Only a genuine provider or system error in the transcript can override it.
diff --git a/server/lib/aiToolkit/errorDetection.js b/server/lib/aiToolkit/errorDetection.js
index 80c7cd6435..d162628290 100644
--- a/server/lib/aiToolkit/errorDetection.js
+++ b/server/lib/aiToolkit/errorDetection.js
@@ -104,6 +104,17 @@ const WAIT_TIME_PATTERNS = [
];
const IMMEDIATE_FALLBACK_SIGNALS = [
+ {
+ // Antigravity leaves its composer visible while Google verifies account
+ // eligibility, so a CoS TUI agent can appear ready, accept a paste, then
+ // do no work until the idle reaper eventually kills it. This exact two-line
+ // banner is provider chrome (not a generic auth word an agent may print),
+ // making it safe to fail immediately and let the task select a fallback.
+ pattern: /We're finishing verifying your account eligibility\.\s*This usually takes a moment\. Please try again shortly\./i,
+ category: ERROR_CATEGORIES.AUTH_ERROR,
+ message: 'Antigravity account eligibility is still being verified',
+ suggestedFix: 'Wait for the Antigravity account verification to complete, or select another provider and retry.'
+ },
{
pattern: /^\s*(?:\[stderr\]\s*)?Now using extra usage\s*(?:\r?\n|$)/im,
category: ERROR_CATEGORIES.USAGE_LIMIT,
diff --git a/server/lib/aiToolkit/errorDetection.test.js b/server/lib/aiToolkit/errorDetection.test.js
index 5080e1c542..f4ebd174e5 100644
--- a/server/lib/aiToolkit/errorDetection.test.js
+++ b/server/lib/aiToolkit/errorDetection.test.js
@@ -130,6 +130,27 @@ describe('Error Detection', () => {
});
describe('detectImmediateFallbackSignal', () => {
+ it('detects Antigravity account-eligibility blocks before an agent idles out', () => {
+ const result = detectImmediateFallbackSignal(
+ "We're finishing verifying your account eligibility. This usually takes a moment. Please try again shortly."
+ );
+ expect(result).toMatchObject({
+ hasError: true,
+ category: ERROR_CATEGORIES.AUTH_ERROR,
+ requiresFallback: true,
+ suggestedFix: expect.stringContaining('verification')
+ });
+ });
+
+ it('buffers an Antigravity account-eligibility block across stream chunks', () => {
+ const detect = createImmediateFallbackSignalDetector();
+ expect(detect("We're finishing verifying your account eligibility. This usually ")).toBeNull();
+ expect(detect('takes a moment. Please try again shortly.')).toMatchObject({
+ category: ERROR_CATEGORIES.AUTH_ERROR,
+ requiresFallback: true
+ });
+ });
+
it('detects the Claude extra-usage status line', () => {
const result = detectImmediateFallbackSignal('Now using extra usage');
expect(result).toMatchObject({
diff --git a/server/services/agentTuiSpawning.test.js b/server/services/agentTuiSpawning.test.js
index d341dda8d8..b4cc63a4a9 100644
--- a/server/services/agentTuiSpawning.test.js
+++ b/server/services/agentTuiSpawning.test.js
@@ -1146,6 +1146,25 @@ describe('spawnTuiAgent runtime', () => {
);
});
+ it('fails immediately when Antigravity reports that account eligibility is still being verified', async () => {
+ runSpawn({ tuiConfig: agyTuiConfig });
+ await flushMicrotasks();
+
+ await capturedOnData(Buffer.from(
+ "We're finishing verifying your account eligibility. This usually takes a moment. Please try again shortly."
+ ));
+ await flushMicrotasks();
+
+ expect(agentLifecycle.finalizeAgent).toHaveBeenCalledWith(
+ expect.objectContaining({
+ agentId: 'agent-1',
+ success: false,
+ completionReason: 'fallback-signal',
+ error: expect.stringContaining('account eligibility')
+ })
+ );
+ });
+
// ── 1a-bis. Non-counter TUI provider keeps the permissive idle-complete ──────
// The work-counter signal only exists on Claude Code / Codex. On a provider
// that never renders it (Antigravity/Gemini), absence proves nothing — so a