fix: remove cpulimit, use nice only for CPU priority

cpulimit -f interfered with Claude's Ink terminal UI causing duplicate
prompt rendering. Replaced with nice-only approach.

- Remove cpulimit entirely (was causing display issues)
- Rename CpuLimitConfig -> NiceConfig for clean naming
- Simplify wrapWithCpuLimit -> wrapWithNice
- Update UI labels and settings key (cpuLimit -> nice)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-27 11:43:20 +01:00
co-authored by Claude Opus 4.5
parent f92d009034
commit c4e5337480
8 changed files with 90 additions and 236 deletions
+10 -23
View File
@@ -86,12 +86,10 @@ export interface SessionState {
parentAgentId?: string;
/** Child agent IDs spawned by this session */
childAgentIds?: string[];
/** CPU limiting enabled */
cpuLimitEnabled?: boolean;
/** Nice value for CPU priority (-20 to 19) */
cpuLimitNiceValue?: number;
/** CPU limit percentage (1-100) */
cpuLimitPercent?: number;
/** Nice priority enabled */
niceEnabled?: boolean;
/** Nice value (-20 to 19) */
niceValue?: number;
}
// ========== Global Stats Types ==========
@@ -239,33 +237,22 @@ export interface AppState {
tokenStats?: TokenStats;
}
// ========== CPU Limiting Types ==========
// ========== Nice Priority Types ==========
/**
* Configuration for CPU limiting of Claude sessions.
*
* Uses `nice` (always available) to lower process priority and
* optionally `cpulimit` (if installed) for hard CPU usage limits.
* Configuration for process priority using `nice`.
* Lower priority reduces CPU contention with other processes.
*/
export interface CpuLimitConfig {
/** Whether CPU limiting is enabled */
export interface NiceConfig {
/** Whether nice priority is enabled */
enabled: boolean;
/** Nice value (-20 to 19, default: 10 = lower priority) */
niceValue: number;
/** CPU limit percentage (1-100, default: 80) */
cpuLimitPercent: number;
/** Whether to use cpulimit if available (default: true) */
useCpulimitIfAvailable: boolean;
}
/**
* Default CPU limit configuration
*/
export const DEFAULT_CPU_LIMIT_CONFIG: CpuLimitConfig = {
export const DEFAULT_NICE_CONFIG: NiceConfig = {
enabled: false,
niceValue: 10,
cpuLimitPercent: 80,
useCpulimitIfAvailable: true,
};
// ========== Respawn Controller Types ==========