{"record":{"id":"7225f3edbfde67aa","repo":"affaan-m/ECC","slug":"checked-goal-text","errorCode":null,"errorMessage":"checked goal text","messagePattern":"checked goal text","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":7242,"sourceCode":"                    target_session_id.as_deref(),\n                    draft.priority.unwrap_or(TaskPriorityArg::Normal).into(),\n                    draft.agent.as_deref().unwrap_or(&cfg.default_agent),\n                    draft.profile.as_deref(),\n                    draft.use_worktree.unwrap_or(cfg.auto_create_worktrees),\n                    session::SessionGrouping {\n                        project: draft.project.clone(),\n                        task_group: draft.task_group.clone(),\n                    },\n                    \"migrate_remote\",\n                    None,\n                )?\n            }\n            session::RemoteDispatchKind::ComputerUse => {\n                let defaults = cfg.computer_use_dispatch_defaults();\n                session::manager::create_computer_use_remote_dispatch_request(\n                    db,\n                    cfg,\n                    body_text.expect(\"checked goal text\"),\n                    draft.target_url.as_deref(),\n                    draft.context.as_deref(),\n                    target_session_id.as_deref(),\n                    draft.priority.unwrap_or(TaskPriorityArg::Normal).into(),\n                    draft.agent.as_deref(),\n                    draft.profile.as_deref(),\n                    Some(draft.use_worktree.unwrap_or(defaults.use_worktree)),\n                    session::SessionGrouping {\n                        project: draft.project.clone(),\n                        task_group: draft.task_group.clone(),\n                    },\n                    \"migrate_remote_computer_use\",\n                    None,\n                )?\n            }\n        };\n\n        item.status = LegacyRemoteImportRequestStatus::Imported;","sourceCodeStart":7224,"sourceCodeEnd":7260,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/main.rs#L7224-L7260","documentation":"Same invariant pattern as the Standard branch but for computer-use dispatch: body_text.expect(\"checked goal text\") asserts the goal text was validated earlier. If None reaches this point, the binary panics, indicating the pre-validation of the computer-use goal was skipped.","triggerScenarios":"A computer-use remote dispatch where the goal-text validation step did not populate body_text before create_computer_use_remote_dispatch_request is called.","commonSituations":"New or modified dispatch flows missing the goal check, or a command variant that reaches ComputerUse dispatch with an empty goal (e.g. empty --goal or empty stdin).","solutions":["Ensure the goal text is validated/non-empty before entering the match, replacing expect with an explicit bail.","Trace why the earlier check was skipped for this command path.","If hit as a user, confirm a non-empty goal was supplied to the computer-use dispatch command."],"exampleFix":"// before\nsession::manager::create_computer_use_remote_dispatch_request(\n    db, cfg, body_text.expect(\"checked goal text\"), /* ... */)\n// after\nlet goal = body_text.ok_or_else(|| anyhow::anyhow!(\"goal text is required for computer-use dispatch\"))?;\nsession::manager::create_computer_use_remote_dispatch_request(db, cfg, goal, /* ... */)","handlingStrategy":"validation","validationCode":"let goal = draft.goal_text.as_deref().map(str::trim).filter(|t| !t.is_empty());\nanyhow::ensure!(goal.is_some(), \"goal text required for computer-use dispatch\");","typeGuard":null,"tryCatchPattern":"// any occurrence of this panic indicates a skipped validation:\nstd::panic::catch_unwind(|| dispatch_computer_use(...)).unwrap_or_else(|_| {\n    eprintln!(\"internal error: goal text validation skipped — please report\");\n});","preventionTips":["Require a non-empty goal before entering the ComputerUse branch","Replace expect() on Option with explicit error returns","Test computer-use dispatch with empty/whitespace goals","Centralize body_text validation for all dispatch kinds"],"tags":["panic","invariant","computer-use"],"backgroundTag":"internal-invariant-violation","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}