mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 07:29:42 +02:00
chore: bump version to 0.1479
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ import type {
|
||||
CycleOutcome,
|
||||
HealthStatus,
|
||||
} from './types.js';
|
||||
import type { TeamWatcher } from './team-watcher.js';
|
||||
|
||||
// ========== Constants ==========
|
||||
|
||||
@@ -638,6 +639,9 @@ export class RespawnController extends EventEmitter {
|
||||
/** The session being controlled */
|
||||
private session: Session;
|
||||
|
||||
/** Optional team watcher for team-aware idle detection */
|
||||
private teamWatcher: TeamWatcher | null = null;
|
||||
|
||||
/** Current configuration */
|
||||
private config: RespawnConfig;
|
||||
|
||||
@@ -1231,6 +1235,10 @@ export class RespawnController extends EventEmitter {
|
||||
*
|
||||
* @fires stateChanged - Transitions to 'watching'
|
||||
*/
|
||||
setTeamWatcher(watcher: TeamWatcher | null): void {
|
||||
this.teamWatcher = watcher;
|
||||
}
|
||||
|
||||
start(): void {
|
||||
if (!this.config.enabled) {
|
||||
this.log('Respawn is disabled');
|
||||
@@ -2183,6 +2191,12 @@ export class RespawnController extends EventEmitter {
|
||||
// Get the terminal buffer for analysis
|
||||
const buffer = this.terminalBuffer.value;
|
||||
|
||||
// Inject teammate context for team-aware AI check
|
||||
if (this.teamWatcher) {
|
||||
const count = this.teamWatcher.getActiveTeammateCount(this.session.id);
|
||||
this.aiChecker.setTeammateCount(count);
|
||||
}
|
||||
|
||||
this.aiChecker.check(buffer).then((result) => {
|
||||
// If state changed while checking (e.g., cancelled), ignore result
|
||||
if (this._state !== 'ai_checking') {
|
||||
@@ -2736,6 +2750,17 @@ export class RespawnController extends EventEmitter {
|
||||
return;
|
||||
}
|
||||
|
||||
// Team-awareness: don't respawn if teammates are active
|
||||
if (this.teamWatcher?.hasActiveTeammates(this.session.id)) {
|
||||
this.log(`Idle confirmation rejected - active teammates working (reason was: ${reason})`);
|
||||
this.logAction('detection', 'Rejected: Active teammates');
|
||||
this.emit('respawnBlocked', { reason: 'active_teammates', details: 'Team has active teammates' });
|
||||
this.setState('watching');
|
||||
this.startNoOutputTimer();
|
||||
this.startPreFilterTimer();
|
||||
return;
|
||||
}
|
||||
|
||||
this.log(`Idle confirmed via: ${reason}`);
|
||||
const status = this.getDetectionStatus();
|
||||
this.log(`Detection status: confidence=${status.confidenceLevel}%, ` +
|
||||
|
||||
Reference in New Issue
Block a user