{"record":{"id":"df57cfbc14c6d40f","repo":"gastownhall/beads","slug":"reading-another-process-s-command-line-is-not-supp","errorCode":null,"errorMessage":"reading another process's command line is not supported on windows","messagePattern":"reading another process's command line is not supported on windows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/storage/dbproxy/proxy/unverified_process_windows.go","lineNumber":69,"sourceCode":"\nfunc (p *unverifiedProcess) executableBasename() (basename string, gone bool, err error) {\n\tbuffer := make([]uint16, 32768)\n\tsize := uint32(len(buffer))\n\tif err := windows.QueryFullProcessImageName(p.handle, 0, &buffer[0], &size); err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"query image name for pid %d: %w\", p.pid, err)\n\t}\n\treturn filepath.Base(syscall.UTF16ToString(buffer[:size])), false, nil\n}\n\n// commandLineContains cannot establish workspace scope on Windows: another\n// process's command line is only reachable through undocumented PEB reads,\n// so force-stop refuses rather than signaling on basename alone.\nfunc (p *unverifiedProcess) commandLineContains(string) (matched bool, gone bool, err error) {\n\texited, exitErr := handleExited(p.handle)\n\tif exitErr == nil && exited {\n\t\treturn false, true, nil\n\t}\n\treturn false, false, errors.New(\"reading another process's command line is not supported on windows\")\n}\n\n// kill terminates the process through the held handle. gone reports a target\n// that had already exited.\nfunc (p *unverifiedProcess) kill() (gone bool, err error) {\n\tif err := windows.TerminateProcess(p.handle, 1); err != nil {\n\t\tif exited, exitErr := handleExited(p.handle); exitErr == nil && exited {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"terminate pid %d: %w\", p.pid, err)\n\t}\n\treturn false, nil\n}\n\nfunc (p *unverifiedProcess) exited() (bool, error) {\n\treturn handleExited(p.handle)\n}\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/proxy/unverified_process_windows.go#L51-L87","documentation":"On Windows, the unverifiedProcess implementation cannot read another process's command line, so commandLineContains always fails with this error. Force-stop therefore refuses to verify workspace scoping via command line on Windows and will not signal the process, per the 'refuse rather than guess' policy.","triggerScenarios":"Calling ForceStopUnverified on Windows where matching requires inspecting a foreign process's command line (e.g. verifying the process belongs to this workspace).","commonSituations":"Running beads force-stop on Windows with legacy/paired records whose basename alone (bd/dolt) is insufficient to establish workspace scope.","solutions":["On Windows, stop the process manually (Task Manager / taskkill) after visually confirming it belongs to this workspace","Delete the stale pidfile once the process is confirmed dead","Handle this error in tooling by falling back to manual cleanup instead of retrying"],"exampleFix":"// before\nmatched, gone, err := proc.commandLineContains(ws)\n// after\nmatched, gone, err := proc.commandLineContains(ws)\nif err != nil && runtime.GOOS == \"windows\" {\n    return fmt.Errorf(\"manual verification required: %w\", err)\n}","handlingStrategy":"fallback","validationCode":"if runtime.GOOS == \"windows\" {\n    // command-line verification unsupported; plan manual cleanup\n    return manualForceStopGuidance(record)\n}","typeGuard":null,"tryCatchPattern":"matched, gone, err := proc.commandLineContains(ws)\nif err != nil {\n    if runtime.GOOS == \"windows\" {\n        return fmt.Errorf(\"verify manually (tasklist/taskkill): %w\", err)\n    }\n    return err\n}","preventionTips":["Don't rely on command-line inspection in cross-platform kill paths","On Windows, verify workspace scope via other means (pidfile pairing) before killing","Document manual taskkill steps for Windows users hitting force-stop refusals"],"tags":["go","windows","platform-limitation"],"backgroundTag":"unsupported-on-windows","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}