Feature: Auto-suspend idle sessions #10

Closed
opened 2026-03-10 03:46:35 +00:00 by Mark · 2 comments
Owner

Issue

Running sessions consume resources indefinitely. Auto-suspending idle sessions would save resources.

Location

  • services/orchestrator/orchestrator.py
  • Session monitoring logic

Current Implementation

Orchestrator only monitors but doesn't auto-stop sessions.

Proposed Solution

  1. Track session activity (terminal input, file operations)
  2. Configurable idle timeout (default: 30 min)
  3. Warning before suspension
  4. Graceful state preservation via snapshots

Implementation Details

# In orchestrator
def check_idle_sessions(self):
    for session in running_sessions:
        if time_since_last_activity > IDLE_TIMEOUT:
            create_snapshot(session)
            stop_session(session)

Acceptance Criteria

  • Add activity tracking (last_active timestamp)
  • Implement idle detection logic
  • Add configurable timeout setting
  • Create snapshot before auto-suspend
  • Add UI indicator for idle time remaining
  • Allow users to disable auto-suspend per session

Priority: Medium
Type: Feature
References: ROADMAP.md Resource Management

## Issue Running sessions consume resources indefinitely. Auto-suspending idle sessions would save resources. ## Location - `services/orchestrator/orchestrator.py` - Session monitoring logic ## Current Implementation Orchestrator only monitors but doesn't auto-stop sessions. ## Proposed Solution 1. Track session activity (terminal input, file operations) 2. Configurable idle timeout (default: 30 min) 3. Warning before suspension 4. Graceful state preservation via snapshots ## Implementation Details ```python # In orchestrator def check_idle_sessions(self): for session in running_sessions: if time_since_last_activity > IDLE_TIMEOUT: create_snapshot(session) stop_session(session) ``` ## Acceptance Criteria - [ ] Add activity tracking (last_active timestamp) - [ ] Implement idle detection logic - [ ] Add configurable timeout setting - [ ] Create snapshot before auto-suspend - [ ] Add UI indicator for idle time remaining - [ ] Allow users to disable auto-suspend per session **Priority:** Medium **Type:** Feature **References:** ROADMAP.md Resource Management
Author
Owner

GSD VERIFY phase failed after 3 attempts.
═══ Gate: verify-passed (devforge#10) ═══
Mode: Tier 1 (functional only)

GATE OK: All gates up to 'implement' pass
── Tier 1: Functional ────────────────────────────────
Running tests...
❌ Tests failed (exit 1)
 FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > decodeTerminalMessage > should return empty Uint8Array for Blob input in sync decoder
 FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > debug mode > should return false when debug is not enabled
 FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > debug mode > should return true when debug is enabled
 FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > debug mode > should disable debug mode
ReferenceError: localStorage is not defined
 ❯ services/web/src/utils/terminalUtils.test.ts:12:5
 10|  beforeEach(() => {
 11|  vi.restoreAllMocks();
 12|  localStorage.clear();
 |  ^
 13|  });
 14| 

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/9]⎯

 Test Files  4 failed | 1 passed (5)
 Tests  6 failed | 4 passed (10)
 Start at  01:39:58
 Duration  645ms (transform 512ms, setup 0ms, import 142ms, tests 11ms, environment 1ms)
Running linter...
✅ Lint clean
⚠️ No type checker discovered
Previous test count: unknown

❌ GATE FAIL: verify-passed
- Tests failed with exit code 1
GATE FAIL: verify — blocked at 2026-05-21T08:40:00Z
Class: test-failure
Evidence: Verification failed: 1 failures
Git tag: devforge#10-gate-verify-fail-17424555cd2c (use gate-retry after fixing)

GSD VERIFY phase failed after 3 attempts. ═══ Gate: verify-passed (devforge#10) ═══ Mode: Tier 1 (functional only) GATE OK: All gates up to 'implement' pass ── Tier 1: Functional ──────────────────────────────── Running tests... ❌ Tests failed (exit 1)  FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > decodeTerminalMessage > should return empty Uint8Array for Blob input in sync decoder  FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > debug mode > should return false when debug is not enabled  FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > debug mode > should return true when debug is enabled  FAIL  services/web/src/utils/terminalUtils.test.ts > terminalUtils > debug mode > should disable debug mode ReferenceError: localStorage is not defined  ❯ services/web/src/utils/terminalUtils.test.ts:12:5  10|  beforeEach(() => {  11|  vi.restoreAllMocks();  12|  localStorage.clear();  |  ^  13|  });  14|  ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/9]⎯  Test Files  4 failed | 1 passed (5)  Tests  6 failed | 4 passed (10)  Start at  01:39:58  Duration  645ms (transform 512ms, setup 0ms, import 142ms, tests 11ms, environment 1ms) Running linter... ✅ Lint clean ⚠️ No type checker discovered Previous test count: unknown ❌ GATE FAIL: verify-passed - Tests failed with exit code 1 GATE FAIL: verify — blocked at 2026-05-21T08:40:00Z Class: test-failure Evidence: Verification failed: 1 failures Git tag: devforge#10-gate-verify-fail-17424555cd2c (use gate-retry after fixing)
Author
Owner

GSD RESEARCH phase could not determine a clear fix.

]11;?\Now I have the complete picture. Let me provide my evaluation:

STATUS: UNCLEAR

EVIDENCE:
The feature is partially implemented but non-functional:

Already exists:

  • last_activity_at field on Session model (models.py:71-72)
  • idle_timeout_hours field on Session model (models.py:74)
  • Idle detection logic in HealthMonitor.cleanup_old_sessions() (health.py:182-203)
  • Stops containers when idle_hours > session.idle_timeout_hours

**Critical gap - activity tracking nev

GSD RESEARCH phase could not determine a clear fix. ]11;?\Now I have the complete picture. Let me provide my evaluation: STATUS: UNCLEAR EVIDENCE: The feature is **partially implemented but non-functional**: **Already exists:** - `last_activity_at` field on Session model (`models.py:71-72`) - `idle_timeout_hours` field on Session model (`models.py:74`) - Idle detection logic in `HealthMonitor.cleanup_old_sessions()` (`health.py:182-203`) - Stops containers when `idle_hours > session.idle_timeout_hours` **Critical gap - activity tracking nev
Mark 2026-08-12 18:30:30 +00:00
Sign in to join this conversation.
No description provided.