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 review: trailing newline after multi-line context, reset initialized/conflicted on submodule update, ref-based double-submit guard for task form

Adam Eivy903e423e7ed7
diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsx
index ee9011fe55..770e8de1a0 100644
--- a/client/src/components/cos/TaskAddForm.jsx
+++ b/client/src/components/cos/TaskAddForm.jsx
@@ -24,6 +24,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
const [templateNameInput, setTemplateNameInput] = useState('');
const [showTemplateSave, setShowTemplateSave] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false);
+ const submittingRef = useRef(false);
const fileInputRef = useRef(null);
const attachmentInputRef = useRef(null);
@@ -152,12 +153,13 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
};
const handleAddTask = async () => {
- if (isSubmitting) return;
+ if (submittingRef.current) return;
if (!newTask.description.trim()) {
toast.error('Description is required');
return;
}
+ submittingRef.current = true;
setIsSubmitting(true);
let finalDescription = newTask.description;
@@ -206,6 +208,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
return null;
});
+ submittingRef.current = false;
setIsSubmitting(false);
setIsEnhancing(false);
diff --git a/client/src/pages/Submodules.jsx b/client/src/pages/Submodules.jsx
index cda188c9e5..42d9988a73 100644
--- a/client/src/pages/Submodules.jsx
+++ b/client/src/pages/Submodules.jsx
@@ -29,7 +29,7 @@ export default function Submodules() {
toast.success(`Updated ${subPath} to ${result.newCommit}`);
setSubmodules(prev => prev.map(s =>
s.path === subPath
- ? { ...s, currentCommit: result.newCommit, behind: 0, outOfSync: false }
+ ? { ...s, currentCommit: result.newCommit, behind: 0, outOfSync: false, initialized: true, conflicted: false }
: s
));
} else {
diff --git a/server/services/agentPromptBuilder.js b/server/services/agentPromptBuilder.js
index e03d76a718..a2a3b2b47d 100644
--- a/server/services/agentPromptBuilder.js
+++ b/server/services/agentPromptBuilder.js
@@ -291,7 +291,7 @@ You are an autonomous agent working on behalf of the Chief of Staff.
- **ID**: ${task.id}
- **Priority**: ${task.priority}
- **Description**: ${task.description}
-${task.metadata?.context ? (task.metadata.context.includes('\n') ? `\n### Task Context\n\n${task.metadata.context}` : `- **Context**: ${task.metadata.context}`) : ''}
+${task.metadata?.context ? (task.metadata.context.includes('\n') ? `\n### Task Context\n\n${task.metadata.context.trimEnd()}\n` : `- **Context**: ${task.metadata.context}`) : ''}
${task.metadata?.app ? `- **Target App**: ${task.metadata.app}\n- **Target App Directory**: ${workspaceDir}` : ''}
${Array.isArray(task.metadata?.screenshots) && task.metadata.screenshots.length > 0 ? `- **Screenshots**: ${task.metadata.screenshots.join(', ')}` : ''}
${worktreeSection}