Skip to content

fix(system-prompt): restore CPU model on non-Linux hosts#4765

Closed
aznikline wants to merge 1 commit into
can1357:mainfrom
aznikline:fix/cpu-model-non-linux
Closed

fix(system-prompt): restore CPU model on non-Linux hosts#4765
aznikline wants to merge 1 commit into
can1357:mainfrom
aznikline:fix/cpu-model-non-linux

Conversation

@aznikline

Copy link
Copy Markdown

Fixes #4755.

#4717 switched getCpuModel() to /proc/cpuinfo to avoid an os.cpus() startup stall on Linux (#4712), but returned undefined for non-Linux, so the workstation block dropped CPU: on macOS/Windows — a regression.

Fix: fall back to os.cpus()[0].model on non-Linux. The #4712 stall is Linux-specific, so os.cpus() is safe on macOS/Windows. Linux keeps /proc/cpuinfo unchanged.

Test: added a non-Linux test (skipped on Linux) asserting os.cpus() is called and the model reaches the systemPrompt array. Existing Linux-only test untouched.

Verification: bun test src/system-prompt.test.ts → 1 pass, 5 skip, 0 fail.

can1357#4717 switched getCpuModel() to /proc/cpuinfo to avoid an os.cpus() startup stall on Linux (can1357#4712), but returned undefined for non-Linux, so the workstation block dropped the CPU line on macOS/Windows. Fall back to os.cpus()[0].model on non-Linux — the can1357#4712 stall is Linux-specific. Linux keeps /proc/cpuinfo. Test added.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Hi @aznikline, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/can1357/oh-my-pi/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: CPU model line is dropped on non-Linux hosts after #4717

1 participant