{"record":{"id":"c5b0125cce8d74ef","repo":"langgenius/dify","slug":"failed-to-save-agent-composer-draft","errorCode":null,"errorMessage":"Failed to save agent composer draft.","messagePattern":"Failed to save agent composer draft\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.ts","lineNumber":154,"sourceCode":"    }) => {\n      const savedDraftKey = JSON.stringify(configSnapshot)\n      const saveSequence = ++nextSaveSequenceRef.current\n      try {\n        await saveComposerDraft({\n          params: {\n            agent_id: agentId,\n          },\n          body: {\n            variant: 'agent_app',\n            save_strategy: 'save_to_current_version',\n            agent_soul: configSnapshot,\n          },\n        })\n      } catch (error) {\n        // Autosave is silent and keeps the local draft intact; explicit commands must stop at this boundary.\n        if (!silent) {\n          if (publish) throw error\n          throw new Error('Failed to save agent composer draft.')\n        }\n\n        return false\n      }\n\n      applySavedDraft({\n        draftBaseline,\n        draftKey: savedDraftKey,\n        saveSequence,\n      })\n\n      if (publish) {\n        await publishAgent({\n          params: {\n            agent_id: agentId,\n          },\n          body: {},\n        })","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.ts#L136-L172","documentation":"Error \"Failed to save agent composer draft.\" thrown in langgenius/dify.","triggerScenarios":"Thrown at web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.ts:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}