sipeed/picoclaw · error

Failed to parse current config

Error message

Failed to parse current config

What it means

Error "Failed to parse current config" thrown in sipeed/picoclaw.

Source

Thrown at web/backend/api/config.go:163

		http.Error(w, fmt.Sprintf("Invalid JSON: %v", err), http.StatusBadRequest)
		return
	}

	// Load existing config and marshal to a map for merging
	cfg, err := config.LoadConfig(h.configPath)
	if err != nil {
		http.Error(w, fmt.Sprintf("Failed to load config: %v", err), http.StatusInternalServerError)
		return
	}
	existing, err := json.Marshal(cfg)
	if err != nil {
		http.Error(w, "Failed to serialize current config", http.StatusInternalServerError)
		return
	}

	var base map[string]any
	if err = json.Unmarshal(existing, &base); err != nil {
		http.Error(w, "Failed to parse current config", http.StatusInternalServerError)
		return
	}

	// Recursively merge patch into base
	mergeMap(base, patch)

	// When the patch updates dm_scope, the old derived dimensions from the
	// base must be cleared so that ApplyDmScope() can re-derive them from
	// the new dm_scope value. Otherwise the stale dimensions survive the
	// merge and ApplyDmScope() exits early due to its precedence guard.
	if sess, ok := base["session"].(map[string]any); ok {
		if patchSess, patchHasSession := patch["session"].(map[string]any); patchHasSession {
			if _, hasDmScope := patchSess["dm_scope"]; hasDmScope {
				if _, hasDimsInPatch := patchSess["dimensions"]; !hasDimsInPatch {
					delete(sess, "dimensions")
				}
			}
		}

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at web/backend/api/config.go:163 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/d138b2acdfa045c2. Report an issue: GitHub.