Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Why

- The Active Agents companion already distinguishes `working` from `thinking`, but long-idle clean sessions still blend into the same neutral styling.
- VS Code tree-item decorations need a stable `resourceUri`, so session rows need a synthetic URI that stays tied to the branch identity instead of a real file path.

## What Changes

- Add a `vscode.FileDecorationProvider` for synthetic `gitguardex-agent://<sanitized-branch>` session URIs.
- Set `SessionItem.resourceUri` from the session branch so idle clean lanes can be decorated without affecting changed-file rows.
- Surface idle thresholds for clean sessions: yellow after 10 minutes, red after 30 minutes, while leaving `working` lanes on their existing styling.
- Fire decoration refreshes whenever the Active Agents tree refreshes so elapsed-idle styling stays current.

## Impact

- Highlights stale clean lanes in the Source Control companion without altering working-session emphasis.
- Keeps decoration behavior branch-stable across reloads and session refreshes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## ADDED Requirements

### Requirement: Active Agents rows expose synthetic branch decoration URIs
The VS Code Active Agents companion SHALL assign each session row a synthetic `gitguardex-agent://<sanitized-branch>` resource URI so tree decorations can target live Guardex branches without pointing at a real file on disk.

#### Scenario: Session rows use sanitized branch identity
- **WHEN** the companion renders a live session row
- **THEN** the row `resourceUri` uses the `gitguardex-agent` scheme
- **AND** the URI path is derived from the branch name with the same sanitization used for session-state filenames.

### Requirement: Idle clean sessions are color-coded by elapsed time
The VS Code Active Agents companion SHALL decorate clean live sessions according to how long they have stayed idle.

#### Scenario: Clean session idle longer than ten minutes warns in yellow
- **WHEN** a live session has no working changes and has been running for more than 10 minutes but not more than 30 minutes
- **THEN** the session row decoration uses a yellow warning color
- **AND** the decoration tooltip reads `idle 10m+`.

#### Scenario: Clean session idle longer than thirty minutes warns in red
- **WHEN** a live session has no working changes and has been running for more than 30 minutes
- **THEN** the session row decoration uses a red error color
- **AND** the decoration tooltip reads `idle 30m+`.

#### Scenario: Working sessions keep their existing styling
- **WHEN** a live session currently has working changes in its sandbox worktree
- **THEN** the decoration provider returns no color override for that row.

### Requirement: Tree refreshes also refresh idle decorations
The VS Code Active Agents companion SHALL invalidate session decorations whenever the tree data refreshes.

#### Scenario: Refresh path fires decoration updates
- **WHEN** the tree refresh callback runs because of timers, watchers, or manual refresh
- **THEN** the file-decoration provider emits `onDidChangeFileDecorations`
- **AND** idle decoration colors can update without reloading the extension host.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Definition of Done

This change is complete only when **all** of the following are true:

- Every checkbox below is checked.
- The agent branch reaches `MERGED` state on `origin` and the PR URL + state are recorded in the completion handoff.
- If any step blocks (test failure, conflict, ambiguous result), append a `BLOCKED:` line under section 4 explaining the blocker and **STOP**. Do not tick remaining cleanup boxes; do not silently skip the cleanup pipeline.

## 1. Specification

- [x] 1.1 Capture the synthetic session URI and idle-decoration rules in branch-local OpenSpec artifacts.

## 2. Implementation

- [x] 2.1 Add a session decoration provider keyed by `gitguardex-agent://<sanitized-branch>` URIs and assign `resourceUri` on `SessionItem`.
- [x] 2.2 Fire decoration refreshes from the Active Agents refresh path and register the provider in `activate()`.
- [x] 2.3 Mirror the extension change into `templates/vscode/guardex-active-agents/extension.js`.
- [x] 2.4 Add or update focused regression coverage for the idle-decoration behavior.

## 3. Verification

- [x] 3.1 Run `node --test test/vscode-active-agents-session-state.test.js`.
- [x] 3.2 Run `openspec validate agent-codex-vscode-tree-lock-decorations-2026-04-22-10-55 --type change --strict`.

## 4. Cleanup (mandatory; run before claiming completion)

- [ ] 4.1 Run the cleanup pipeline: `bash scripts/agent-branch-finish.sh --branch agent/codex/vscode-tree-lock-decorations-2026-04-22-10-55 --base main --via-pr --wait-for-merge --cleanup`.
- [ ] 4.2 Record the PR URL and final merge state (`MERGED`) in the completion handoff.
- [ ] 4.3 Confirm the sandbox worktree is gone (`git worktree list` no longer shows the agent path; `git branch -a` shows no surviving local/remote refs for the branch).
Loading