fix(ui): enumerate codebase-memory-mcp processes on Windows - #955
fix(ui): enumerate codebase-memory-mcp processes on Windows#955EightDoor wants to merge 1 commit into
Conversation
|
Thanks for taking the Windows UI process-list gap. Triage: Windows local-UI bug for #950, normal priority. Review focus is access-denied handling, stable JSON shape, and avoiding exposure of more process detail than the UI needs. |
|
The fix itself looks right — One blocker: DCO fails — the commit is missing its |
|
Reviewed — this is a clean, well-built fix. Using the Win32 toolhelp snapshot ( One correction needed before merge: the PR body and commit both say |
2d68535 to
09a4eb1
Compare
Windows handle_processes previously returned an empty processes array
because it only queried the current process via GetProcessMemoryInfo/
GetProcessTimes. POSIX uses popen("ps") to enumerate all instances.
Add process enumeration via CreateToolhelp32Snapshot + Process32First/
Process32Next to find all codebase-memory-mcp.exe processes, query per-
process CPU/memory/elapsed time via OpenProcess + GetProcessTimes +
GetProcessMemoryInfo, and return them in the JSON response.
Closes DeusData#950
Signed-off-by: 周凯 <851708184@qq.com>
09a4eb1 to
c5ebab6
Compare
|
Thanks for following up, and sorry this sat after you completed the requested work. The DCO correction and #950 reference are present on current head |
|
Thank you for this, and sorry for the long wait — you fixed the DCO promptly and then the branch sat. That was on us. Reviewed at your current head, and the work is good. One small thing stands between it and a merge. What checks out. Using The matching is exact rather than loose — Handle hygiene is correct throughout: every successful The one blocker: an uninitialized read. FILETIME ftc, fte, ftk, ftu;These are uninitialized, and the elapsed-time block reads In practice it is close to unreachable: a handle with Either of these closes it: FILETIME ftc = {0}, fte = {0}, ftk = {0}, ftu = {0};or, cleaner, move the elapsed computation inside the Push that and this merges. Two optional notes, neither blocking:
Thanks again — mirroring the POSIX JSON shape exactly, including |
Problem
On Windows, the Control Panel's Active Processes tab always shows empty because
handle_processesinsrc/ui/http_server.conly queries the current process viaGetProcessMemoryInfo/GetProcessTimesand returns"processes":[]. The POSIX path usespopen("ps")to enumerate allcodebase-memory-mcpinstances.Closes #950
Solution
Added Windows process enumeration via
CreateToolhelp32Snapshot+Process32First/Process32Nextto find allcodebase-memory-mcp.exeinstances. For each matching process:OpenProcesswithPROCESS_QUERY_INFORMATION | PROCESS_VM_READGetProcessTimes(user + system)GetProcessMemoryInfo(WorkingSetSize)is_selfflagChanges
src/ui/http_server.c: Added#include <tlhelp32.h>and ~70 lines of process enumeration logicEdge Cases Handled
OpenProcessfailure (skips process)GetProcessMemoryInfo/GetProcessTimesfailure (zeros fallback)CreateToolhelp32Snapshotfailure (returns empty array)Test Plan
build-windows/build-windows-arm64jobs compile successfullycodebase-memory-mcpinstances, verify Active Processes tab shows all instances with CPU/memory/elapsed values