multica-ai/multica · error

write config.toml: %w

Error message

write config.toml: %w

What it means

After rendering the updated config with the multica-managed sandbox block, os.WriteFile to config.toml failed. The sandbox policy (including any danger-full-access fallback) could not be persisted, so the task does not start with the intended sandbox config.

Source

Thrown at server/internal/daemon/execenv/codex_sandbox.go:475

	if policy.Mode == "danger-full-access" && logger != nil {
		version := detectedVersion
		if version == "" {
			version = "unknown"
		}
		attrs := []any{
			"reason", policy.Reason,
			"codex_version", version,
			"config_path", configPath,
		}
		if policy.Hint != "" {
			attrs = append(attrs, "hint", policy.Hint)
		}
		logger.Warn("codex sandbox: running unsandboxed with danger-full-access", attrs...)
	}

	if err := os.WriteFile(configPath, []byte(updated), 0o644); err != nil {
		return fmt.Errorf("write config.toml: %w", err)
	}
	return nil
}

// --- small semver helper, scoped to this package to avoid an import cycle
// with server/pkg/agent. The agent package already has a similar parser; we
// duplicate the minimal bits here because execenv cannot depend on agent.

type codexSemver struct {
	Major, Minor, Patch int
}

var codexSemverRe = regexp.MustCompile(`v?(\d+)\.(\d+)\.(\d+)`)

func parseCodexSemver(raw string) (codexSemver, error) {
	m := codexSemverRe.FindStringSubmatch(raw)
	if m == nil {
		return codexSemver{}, fmt.Errorf("cannot parse version %q", raw)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Free disk space on the task home volume
  2. Verify the daemon user has write access to the config.toml path
  3. Remove any process locking the file and retry prepare
Defensive patterns

Strategy: validation

Validate before calling

if err := os.WriteFile(configPath+".probe", []byte{}, 0o644); err != nil {
	return fmt.Errorf("config path not writable: %w", err)
}
os.Remove(configPath + ".probe")

Prevention

When it happens

Trigger: Task home or config.toml directory not writable; ENOSPC; the file is held open with mandatory locks on Windows.

Common situations: Full disk; permission drift in a reused task home; antivirus/locking software on Windows interfering.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/514e8e4b584ddf15. Report an issue: GitHub.