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: seed the ambient design field from the manifest so a correction-only regenerate is not rejected (#3134)

[._.]/ Adam Eivy1c63a883f1b8
diff --git a/client/src/components/sprites/AmbientWorkflow.jsx b/client/src/components/sprites/AmbientWorkflow.jsx
index 8da84e2ae9..a19b61f111 100644
--- a/client/src/components/sprites/AmbientWorkflow.jsx
+++ b/client/src/components/sprites/AmbientWorkflow.jsx
@@ -15,7 +15,14 @@ export default function AmbientWorkflow({
record, reference, ambient, renders, hasBackend, mode, onGenerateReference, onGenerateAmbient, onChanged,
corrections = null, onCorrectionChange = null,
}) {
- const [designPrompt, setDesignPrompt] = useState('');
+ // Seeded from the manifest's stored design (the server persists it on every
+ // ambient-main render) so a REGENERATE carries the design forward instead of
+ // starting blank. Load-bearing for the correction note (#3134): the server
+ // requires a design input on this target, so a correction typed against an
+ // empty field would 400 with DESIGN_INPUT_REQUIRED. Re-seeded on record switch
+ // only, so it never fights typing within one sprite.
+ const [designPrompt, setDesignPrompt] = useState(reference?.manifest?.designPrompt || '');
+ useEffect(() => { setDesignPrompt(reference?.manifest?.designPrompt || ''); }, [record.id]);
const main = reference?.manifest?.mainReference || null;
const candidate = useMemo(
() => (reference?.candidates || []).find((item) => item.target === 'main') || null,
diff --git a/client/src/components/sprites/AmbientWorkflow.test.jsx b/client/src/components/sprites/AmbientWorkflow.test.jsx
index 4dde82dc0e..78949fb0d0 100644
--- a/client/src/components/sprites/AmbientWorkflow.test.jsx
+++ b/client/src/components/sprites/AmbientWorkflow.test.jsx
@@ -97,3 +97,26 @@ describe('AmbientWorkflow correction notes (#3134)', () => {
expect(screen.queryByRole('button', { name: /correction note/i })).toBeNull();
});
});
+
+// The server requires a design input on the ambient main, so the field must
+// carry the manifest's stored design forward — otherwise a correction typed
+// against a blank field 400s with DESIGN_INPUT_REQUIRED (#3134).
+describe('AmbientWorkflow design prompt', () => {
+ it('seeds the design field from the manifest so a regenerate is not blank', () => {
+ renderAmbient({
+ reference: {
+ manifest: { mainReference: { locked: false }, designPrompt: 'a willow by a pond' },
+ candidates: [CANDIDATE],
+ },
+ });
+ expect(screen.getByLabelText(/Describe this place/i)).toHaveValue('a willow by a pond');
+ // With a design present the regenerate is reachable — which is what makes the
+ // correction note usable at all on this surface.
+ expect(screen.getByRole('button', { name: /Regenerate reference/i })).toBeEnabled();
+ });
+
+ it('stays empty for a record that has never been rendered', () => {
+ renderAmbient({ reference: { manifest: { mainReference: { locked: false } }, candidates: [] } });
+ expect(screen.getByLabelText(/Describe this place/i)).toHaveValue('');
+ });
+});