multica-ai/multica · error

%s %q uses unsupported ~user expansion

Error message

%s %q uses unsupported ~user expansion

What it means

A config path beginning with ~ but not ~/ (e.g. ~alice/codex.toml) cannot be expanded: per-user ~name expansion is deliberately unsupported by this resolver, which only handles the current user's home and shared-home-relative paths.

Source

Thrown at server/internal/daemon/execenv/codex_home.go:1227

// resolveCodexConfigPath maps a path-valued config.toml entry to its source
// file on this host. key is the config key the path came from and only shapes
// the diagnostics, so an operator reading a failure knows which setting to fix.
// A relative path resolves against the shared Codex home — that is the
// directory the config was copied from, and the base Codex itself would have
// used before the per-task home relocated CODEX_HOME.
func resolveCodexConfigPath(configPath, sharedHome, key string) (string, error) {
	if filepath.IsAbs(configPath) {
		return filepath.Clean(configPath), nil
	}
	if strings.HasPrefix(configPath, "~/") || strings.HasPrefix(configPath, `~\`) {
		home, err := os.UserHomeDir()
		if err != nil {
			return "", fmt.Errorf("resolve %s %q: user home: %w", key, configPath, err)
		}
		return filepath.Join(home, configPath[2:]), nil
	}
	if strings.HasPrefix(configPath, "~") {
		return "", fmt.Errorf("%s %q uses unsupported ~user expansion", key, configPath)
	}
	return filepath.Join(sharedHome, filepath.Clean(configPath)), nil
}

func exposeSharedCodexPluginCache(codexHome, sharedHome string) error {
	src := filepath.Join(sharedHome, "plugins", "cache")
	dst := filepath.Join(codexHome, "plugins", "cache")
	if err := os.MkdirAll(src, 0o755); err != nil {
		return fmt.Errorf("create shared plugin cache dir: %w", err)
	}
	if err := os.MkdirAll(filepath.Dir(dst), 0o755); err != nil {
		return fmt.Errorf("create codex plugin dir: %w", err)
	}

	if fi, err := os.Lstat(dst); err == nil {
		isLink := fi.Mode()&os.ModeSymlink != 0
		if isLink {
			if target, readlinkErr := os.Readlink(dst); readlinkErr == nil && target == src {

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Replace ~user/... in the config value with the absolute path to that user's file
  2. Move the file under the shared Codex home and reference it relatively

Example fix

# before
auth_file = "~alice/.codex/auth.json"

# after
auth_file = "/home/alice/.codex/auth.json"
Defensive patterns

Strategy: validation

Validate before calling

if strings.HasPrefix(configPath, "~") && !strings.HasPrefix(configPath, "~/") && !strings.HasPrefix(configPath, `~\`) {
	return fmt.Errorf("~user expansion unsupported; use an absolute path")
}

Prevention

When it happens

Trigger: A Codex config value set to another user's home path like ~shared/config.toml; a literal path that happens to start with a tilde.

Common situations: Config authored for multi-user setups copied into the daemon; docs or templates using ~user syntax.

Related errors


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