Skip to main content

preflight_input_from_meta

Function preflight_input_from_meta 

Source
fn preflight_input_from_meta(
    meta: &HashMap<String, Value>,
    bound_config_dir: Option<PathBuf>,
) -> PreflightInput
Expand description

Lift a block’s meta into a [resume_preflight::PreflightInput].

Every default here must match what the real spawn path uses for the same key, or the preflight predicts something the spawn won’t do — which is worse than not predicting at all, since the pane then states a falsehood confidently.

agent:resume_flag defaulting to "--resume" is that rule doing real work (#2833): it was "" here while all five real spawn-path readers default to "--resume" (the persistent and subprocess branches of agent_handlers/input.rs’s run_agent_turn and of app_api/agent_io.rs’s register_agent_send, plus the eager-resume path in eager_resume.rs — the persistent branch of run_agent_turn is the one that builds PersistentSpawnConfig for a pane’s message send). agent_open.rs only started writing the key recently, so any Claude pane created before that and not respawned since has no agent:resume_flag at all: the spawn still attaches --resume, but the preflight was reporting Unknown and silently suppressing the notice for exactly the long-lived panes this feature exists for. bound_config_dir is identity::resolver::resolve_bound_oauth_config_dir’s answer for this block, and takes precedence over cmd:env whenever it’s Some (reagent P1, second pass on PR #2833).

For an agent bound to an OAuth account, the cmd:env snapshot is simply not where the CLI will look: the real spawn resolves the isolated dir dynamically through inject_identity_env_async (via agent_handlers/input.rs’s build_persistent_spawn_env, which app_api/agent_io.rs‘s agent_send_spawn_env also calls), and reactive.rs already documents that “identity-bound agents’ real CLAUDE_CONFIG_DIR is never the stale cmd:env snapshot” (SPEC_SUBAGENT_WATCHER_IDENTITY_BOUND_CONFIG_DIR_2026_08_22.md). Checking reachability against the wrong directory is worse than not checking: it can warn “fresh” at a pane that will resume perfectly well, or stay quiet at one that’s about to lose its conversation.

None — not identity-bound, or a non-OAuth provider — keeps the cmd:env read, which is correct for those. Same helper and same precedence order subagent_watcher already uses for this exact pre-spawn question.