8000 Activating a folder with no minimal.toml can stop the box, and the code leaves three unconfirmed causes · Issue #3075 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

Activating a folder with no minimal.toml can stop the box, and the code leaves three unconfirmed causes #3075

Open

Description

@norrietaylor

Summary

A tester reported that activating a session in a folder with no minimal.toml (via an editor client wrapper, min-vscode) leaves the box stopped or unusable. Reading the code at 0.7.3 (d1091c4), min session activate never refuses a folder for lacking minimal.toml: it carries on and the daemon writes a default. So the report is credible, but the cause is unconfirmed: no error text was captured, and the code leaves three different candidates that would each print different text. Every path that can stop such a box is in this repo; no client repo needs a change (all five wrappers just call min session activate --no-prompt).

Evidence (code reading only, nothing reproduced)

Carry-on path: resolve_upload_root treats NotFound as Ok(dir) (crates/minimal/src/cmd/project.rs:119); check_project_hooks and activate_hook_budget tolerate a missing mfile (crates/minimal/src/loadouts.rs:358, 430). The daemon runs scaffold_mfile_if_missing before compose and propagates errors (crates/minimald/src/session.rs:2589-2590), writing the default at 6229-6241.

Candidate causes, each with different error text:

  1. min dash at 0.7.3 hard-refuses any non-VCS folder: refusing to upload '...': not a repository root (crates/minimal-tui/src/rpc.rs:616-618). It keys on VCS, not on minimal.toml, so a non-git folder that has a minimal.toml is refused too. Only applies if dash was used. main replaced this with a confirm prompt (crates/minimal/src/dash/render.rs:758, from #2114); not an ancestor of d1091c4.
  2. The daemon scaffold has no fallback. InitProject does update_checkout(DEFAULT_PKGS)? then a full graph load (crates/op/src/project/init.rs:63, 81); Manager::update_remote does repo.fetch()? with no cached fallback once the remote is registered (crates/checkouts/src/lib.rs:438-458). Any failure kills activation with Cannot start a session for <dir>: composing a session environment from that directory's project configuration failed ... cause: scaffolding a default mfile: .... A project with a pinned, already checked-out locked_commit skips the fetch, so a no-toml folder can fail where another project works. Still fatal on main (crates/minimald/src/box_actor/setup.rs:383).
  3. Timeout. Scaffold and compose run inside one ConfigureLoadout RPC capped at RPC_TIMEOUT = 60s (crates/minimal-client/src/lib.rs:193; plain oneshot_rpc at cmd/session.rs:1468), while the checkouts lock may wait up to 600s (crates/checkouts/src/lib.rs:174-179). A cold cache or lock contention would surface as ConfigureLoadout RPC failed. Unchanged on main. Real durations cannot be determined from code.

A weaker, unproven possibility: the scaffold pins pkgs main HEAD, the revision least likely to be cached, so a local build could hit the hang in #3058. Nothing in the code shows that happened.

Ruled out: a --no-prompt approval abort (scaffolded stack build_env_vars are literals, which bypass the policy); the T103 baseline blocking the scaffold fetch (github.com is the built-in registry endpoint). With --no-prompt, a non-VCS no-toml folder skips the upload with a warning and starts an empty /workbench (cmd/session.rs:1394-1418), which a tester could read as broken though the box does start.

Related defects found while reading

  • Misleading wording. composition_failure_message (crates/minimal/src/cmd/mod.rs:1012, raised at cmd/session.rs:1504, 1550) blames "that directory's project configuration" for a folder that has none.
  • Test gap. Under cfg(test)/test-support, default_mfile_plan returns a canned file and skips InitProject (crates/minimald/src/session.rs:6256), so configure_loadout_scaffolds_missing_mfile_into_composition never exercises the production scaffold.
  • --no-prompt ignored by the offer. offer_mfile_scaffold checks global.no_input and the stdin TTY but not args.no_prompt (project.rs:71), so min-vscode open from a terminal still gets the prompt, and a host-side init failure aborts activation via ? at project.rs:97 although the doc comment says "Purely an offer".

What should happen

  1. Get the missing facts from the tester: the exact error text, which client was used, and whether the folder was a git repo. refusing to upload points to candidate 1 (already gone on main; 0.7 4C29 .3 would need a backport or a release note). scaffolding a default mfile or a 60s ConfigureLoadout timeout points to candidates 2/3, which are still live on main.
  2. Make a failed default scaffold non-fatal or give it a bounded, cached fallback, and give the scaffold its own deadline instead of sharing the 60s ConfigureLoadout budget.
  3. Reword the composition failure for a folder with no project configuration, and name the cause and the next step.
  4. Make offer_mfile_scaffold honor --no-prompt, and make its failure non-fatal.
  5. Cover the production scaffold path in a test.

Confidence

The premise (0.7.3 is meant to continue and write a default) is confirmed by reading code. The specific cause is unconfirmed. Limits: checked at d1091c4 on a branch without an rc1 tag, so rc1 may differ; no existing issue found by searching for either error string.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0