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: extract and display task summary separately from simplify output

Adam Eivy6650d29fb217
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c2f29c26bb..de04bb18fa 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -16,6 +16,8 @@
## Fixed
+- **Simplify agent summary visibility** — completed agents that ran with `/simplify` now extract and display a separate "Task Summary" showing what the agent accomplished, so the original work summary is no longer buried under the simplify review output
+
- **Memory dedup — duplicate approval requests** — memory extractor now checks existing active and pending memories (via vector similarity + text prefix matching) before proposing new ones, and the LLM classification prompt now includes existing memories so it avoids re-proposing semantically equivalent knowledge
- **Xcode `deploy.sh` template — altool upload check false-positive** — generated deploy scripts grepped altool output for plain `ERROR: ` to detect upload failures, but altool's multipart uploader logs every transient retry as `ERROR: [ContentDelivery.Uploader.X] WILL RETRY PART N. Checksums do not match.` On flaky/slow networks the script killed deploys mid-recovery. Switched to Apple's definitive failure markers only: `UPLOAD FAILED|Validation failed \(|ERROR ITMS-|product-errors`. Affects iOS, macOS, and watchOS upload sections in `xcodeScripts.js`.
diff --git a/client/src/components/cos/tabs/AgentCard.jsx b/client/src/components/cos/tabs/AgentCard.jsx
index 7470ee5633..fd364747ec 100644
--- a/client/src/components/cos/tabs/AgentCard.jsx
+++ b/client/src/components/cos/tabs/AgentCard.jsx
@@ -693,6 +693,16 @@ export default function AgentCard({ agent, onKill, onDelete, onResume, completed
</div>
)}
+ {completed && agent.metadata?.taskSummary && (
+ <div className="mt-2 bg-port-bg/50 border border-port-border/50 rounded p-2.5">
+ <div className="text-[11px] text-gray-500 mb-1 flex items-center gap-1">
+ <Sparkles size={10} aria-hidden="true" className="text-emerald-400" />
+ Task Summary
+ </div>
+ <MarkdownOutput content={agent.metadata.taskSummary} />
+ </div>
+ )}
+
{/* Feedback section - shown for completed non-system local agents */}
{completed && !isSystemAgent && !remote && (
<div className="mt-3 pt-3 border-t border-port-border/50">
diff --git a/server/cos-runner/index.js b/server/cos-runner/index.js
index a407b80651..d06b41a7c9 100644
--- a/server/cos-runner/index.js
+++ b/server/cos-runner/index.js
@@ -87,6 +87,8 @@ function summarizeToolInput(toolName, input) {
return input.todos?.length ? `${input.todos.length} items` : '';
case 'NotebookEdit':
return shorten(input.notebook_path);
+ case 'Skill':
+ return input.skill || '';
default:
return '';
}
diff --git a/server/services/agentCliSpawning.js b/server/services/agentCliSpawning.js
index 378bd3b03d..7b47039cd9 100644
--- a/server/services/agentCliSpawning.js
+++ b/server/services/agentCliSpawning.js
@@ -20,6 +20,7 @@ import { completeExecution, errorExecution } from './toolStateMachine.js';
import { analyzeAgentFailure, resolveFailedTaskUpdate } from './agentErrorAnalysis.js';
import { completeAgentRun } from './agentRunTracking.js';
import { processAgentCompletion } from './agentCompletion.js';
+import { persistSimplifySummaries } from './agentLifecycle.js';
import { activeAgents, userTerminatedAgents } from './agentState.js';
import { safeJSONParse, PATHS } from '../lib/fileUtils.js';
@@ -61,6 +62,8 @@ export function summarizeToolInput(toolName, input) {
return input.todos?.length ? `${input.todos.length} items` : '';
case 'NotebookEdit':
return shorten(input.notebook_path);
+ case 'Skill':
+ return input.skill || '';
default:
return '';
}
@@ -495,6 +498,10 @@ export async function spawnDirectly(agentId, task, prompt, workspacePath, model,
const analysisBuffer = rawStreamBuffer || outputBuffer;
const errorAnalysis = success ? null : analyzeAgentFailure(analysisBuffer, task, model);
+ if (success) {
+ await persistSimplifySummaries(agentId, task, outputBuffer, isTruthyMetaFn);
+ }
+
await completeAgent(agentId, {
success,
exitCode: code,
diff --git a/server/services/agentLifecycle.js b/server/services/agentLifecycle.js
index 12d401fc0a..83d2c0ebf5 100644
--- a/server/services/agentLifecycle.js
+++ b/server/services/agentLifecycle.js
@@ -650,6 +650,39 @@ export function extractFinalSummary(outputBuffer) {
return summary || null;
}
+const RE_SIMPLIFY_MARKER = /\/simplify/;
+const RE_SIMPLIFY_ACTION = /\b(run|running|launch|now)\b/i;
+
+export function extractSimplifySummaries(outputBuffer) {
+ if (!outputBuffer) return null;
+
+ const lines = outputBuffer.split('\n');
+ let simplifyIdx = -1;
+ for (let i = 0; i < lines.length; i++) {
+ if (RE_SIMPLIFY_MARKER.test(lines[i]) && RE_SIMPLIFY_ACTION.test(lines[i])) {
+ simplifyIdx = i;
+ break;
+ }
+ }
+ if (simplifyIdx < 0) return null;
+
+ const taskSummary = extractFinalSummary(lines.slice(0, simplifyIdx).join('\n'));
+ const simplifySummary = extractFinalSummary(lines.slice(simplifyIdx + 1).join('\n'));
+ return { taskSummary, simplifySummary };
+}
+
+/**
+ * Persist task/simplify summaries for agents that ran with /simplify.
+ * Shared by handleAgentCompletion (runner mode) and spawnDirectly (direct mode).
+ */
+export async function persistSimplifySummaries(agentId, task, outputBuffer, isTruthyMetaFn) {
+ if (!isTruthyMetaFn(task.metadata?.simplify)) return;
+ const summaries = extractSimplifySummaries(outputBuffer);
+ if (summaries?.taskSummary) {
+ await updateAgent(agentId, { metadata: { taskSummary: summaries.taskSummary, simplifySummary: summaries.simplifySummary } });
+ }
+}
+
/**
* Extract a concise output summary for pipeline stage agents.
* For review stages: reads the generated REVIEW.md from the workspace.
@@ -881,6 +914,10 @@ export async function handleAgentCompletion(agentId, exitCode, success, duration
}
}
+ if (effectiveSuccess) {
+ await persistSimplifySummaries(agentId, task, outputBuffer, isTruthyMeta);
+ }
+
await completeAgent(agentId, {
success: effectiveSuccess,
exitCode,
diff --git a/server/services/agentSummaryExtraction.test.js b/server/services/agentSummaryExtraction.test.js
new file mode 100644
index 0000000000..184c795d47
--- /dev/null
+++ b/server/services/agentSummaryExtraction.test.js
@@ -0,0 +1,89 @@
+import { describe, it, expect } from 'vitest';
+import { extractFinalSummary, extractSimplifySummaries } from './agentLifecycle.js';
+
+describe('extractFinalSummary', () => {
+ it('returns the last block of non-tool text', () => {
+ const output = [
+ 'Let me read the code.',
+ '🔧 Using Read...',
+ ' → …/services/cos.js',
+ 'Found the bug. Here is the fix:',
+ '- Fixed null check on line 42',
+ '- Added error handling',
+ ].join('\n');
+ expect(extractFinalSummary(output)).toBe(
+ 'Found the bug. Here is the fix:\n- Fixed null check on line 42\n- Added error handling'
+ );
+ });
+
+ it('returns null for empty output', () => {
+ expect(extractFinalSummary('')).toBeNull();
+ expect(extractFinalSummary(null)).toBeNull();
+ });
+});
+
+describe('extractSimplifySummaries', () => {
+ it('splits output at the /simplify boundary', () => {
+ const output = [
+ 'Let me investigate.',
+ '🔧 Using Read...',
+ ' → …/services/cos.js',
+ 'Fixed the bug. Here is what I did:',
+ '- Fixed null check',
+ '- Added validation',
+ 'Now let me run `/simplify` as instructed.',
+ '🔧 Using Skill...',
+ ' → simplify',
+ 'All three reviews confirm the code is clean.',
+ '- No DRY violations',
+ '- No issues found',
+ ].join('\n');
+
+ const result = extractSimplifySummaries(output);
+ expect(result).not.toBeNull();
+ expect(result.taskSummary).toBe(
+ 'Fixed the bug. Here is what I did:\n- Fixed null check\n- Added validation'
+ );
+ expect(result.simplifySummary).toBe(
+ 'All three reviews confirm the code is clean.\n- No DRY violations\n- No issues found'
+ );
+ });
+
+ it('returns null when no /simplify marker is found', () => {
+ const output = 'Just a regular agent output.\nNo simplify here.';
+ expect(extractSimplifySummaries(output)).toBeNull();
+ });
+
+ it('returns null for empty input', () => {
+ expect(extractSimplifySummaries('')).toBeNull();
+ expect(extractSimplifySummaries(null)).toBeNull();
+ });
+
+ it('handles /simplify marker at the beginning with no pre-summary', () => {
+ const output = [
+ 'Now running `/simplify` review.',
+ '🔧 Using Read...',
+ 'Code is clean.',
+ ].join('\n');
+
+ const result = extractSimplifySummaries(output);
+ // No task summary before the marker
+ expect(result.taskSummary).toBeNull();
+ expect(result.simplifySummary).toBe('Code is clean.');
+ });
+
+ it('matches various /simplify narration patterns', () => {
+ const patterns = [
+ 'Now let me run `/simplify` as instructed.',
+ 'Now running `/simplify` as required by the instructions:',
+ 'Let me now launch /simplify to review.',
+ ];
+ for (const line of patterns) {
+ const output = `Task done.\n${line}\nClean code.`;
+ const result = extractSimplifySummaries(output);
+ expect(result).not.toBeNull();
+ expect(result.taskSummary).toBe('Task done.');
+ expect(result.simplifySummary).toBe('Clean code.');
+ }
+ });
+});