mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-12-01 08:59:32 +01:00
fix: prevent Ralph tracker auto-enable when setting disabled
Add disableAutoEnable mechanism to InnerLoopTracker that prevents pattern-based activation when the user has explicitly disabled the Ralph tracker in settings. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b83124ecd
commit
9801cdf591
2 files changed
+40
-1
No files matched your search
@@ -280,6 +280,9 @@ export class InnerLoopTracker extends EventEmitter {
|
||||
/** Flag indicating pending loopUpdate emission */
|
||||
private _loopUpdatePending: boolean = false;
|
||||
|
||||
/** When true, prevents auto-enable on pattern detection */
|
||||
private _autoEnableDisabled: boolean = false;
|
||||
|
||||
/**
|
||||
* Creates a new InnerLoopTracker instance.
|
||||
* Starts in disabled state until Ralph patterns are detected.
|
||||
@@ -289,6 +292,28 @@ export class InnerLoopTracker extends EventEmitter {
|
||||
this._loopState = createInitialInnerLoopState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent auto-enable from pattern detection.
|
||||
* Use this when the user has explicitly disabled the Ralph tracker.
|
||||
*/
|
||||
disableAutoEnable(): void {
|
||||
this._autoEnableDisabled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow auto-enable from pattern detection.
|
||||
*/
|
||||
enableAutoEnable(): void {
|
||||
this._autoEnableDisabled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether auto-enable is disabled.
|
||||
*/
|
||||
get autoEnableDisabled(): boolean {
|
||||
return this._autoEnableDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the tracker is enabled and actively monitoring output.
|
||||
* Disabled by default; auto-enables when Ralph patterns detected.
|
||||
@@ -500,6 +525,10 @@ export class InnerLoopTracker extends EventEmitter {
|
||||
|
||||
// If tracker is disabled, only check for patterns that should auto-enable it
|
||||
if (!this._loopState.enabled) {
|
||||
// Don't auto-enable if explicitly disabled by user setting
|
||||
if (this._autoEnableDisabled) {
|
||||
return;
|
||||
}
|
||||
if (this.shouldAutoEnable(cleanData)) {
|
||||
this.enable();
|
||||
// Continue processing now that we're enabled
|
||||
|
||||
Reference in new issue
Block a user