fix(system-prompt): restore CPU model on non-Linux hosts#4765
Closed
aznikline wants to merge 1 commit into
Closed
Conversation
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.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.