Skip to content

Simplify Knapper agent sessions - #37

Merged
slate-rehm merged 3 commits into
devfrom
feature/stateless-single-session
Aug 8, 2026
Merged

Simplify Knapper agent sessions#37
slate-rehm merged 3 commits into
devfrom
feature/stateless-single-session

Conversation

@slate-rehm

@slate-rehm slate-rehm commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace agent and workspace handles with one stateless managed session.
  • Publish a fixed startup tool surface and serialize all operations through one FIFO lane.
  • Add cross-process activity ownership with stale detection and active-operation heartbeats.
  • Add a live plugin settings fixture that verifies a real UI toggle and state readback.
  • Remove legacy parallel workspace and lease code.
  • Prepare version 0.7.0-beta.1.

Verification

  • npm run check
  • npm run typecheck
  • npm test: 465 tests
  • npm run smoke
  • npm run acceptance: 20 checks
  • npm run e2e with settings fixture: 92 checks
  • npm run workspaces: 7 checks
  • npm run fence: 16 checks
  • npm run bg-input: 6 checks
  • Codex plugin validation
  • Claude plugin validation

Note

Replace multi-workspace/agent session model with a single managed session in Knapper

  • Removes the workspace/agent handle model entirely: tools no longer accept or inject workspaceHandle/agentHandle; session lifecycle is now managed via obsidian_session_open, obsidian_session_release, and obsidian_session_reset.
  • Introduces ActivityGuard in activity-guard.ts as a cross-process coordination primitive that enforces a single active session at a time, surfacing KNAPPER_BUSY with retryAfterMs to competing callers.
  • Serializes all tool invocations through a single FIFO lane in ToolRegistry (was configurable concurrency); status-only tools bypass activity acquisition.
  • Removes the obsidian_toolsets_update tool; the MCP tool surface is now fixed at initialization with a default set of toolsets (core, ui, telemetry, plugin-dev, editor).
  • Bumps version to 0.7.0-beta.1 and updates all documentation, skills, agent guides, and test scripts to reflect session semantics.
  • Risk: all existing integrations passing workspaceHandle or relying on dynamic toolset updates or multi-workspace isolation will break.

Macroscope summarized 9d6a978.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 32ba660d-b2dd-4a68-b00c-bb8639269390

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Comment thread README.md
Comment thread src/usage/activity-guard.ts Outdated
Comment thread src/tools/provisioning.ts
Comment thread src/tools/registry.ts
Comment thread docs/configuration.md Outdated
Comment thread skills/obsidian-instance-setup/SKILL.md
Comment thread skills/obsidian-instance-setup/SKILL.md Outdated
@slate-rehm

Copy link
Copy Markdown
Collaborator Author

#AI-Automation

CI passed without failures on Node 20, 22, and 24, including the packaged-install gate.

Review-driven changes:

  • Preserved unknown toolset diagnostics when all is selected.
  • Removed the remaining legacy registry constructor arguments.
  • Added remediation to new typed errors.
  • Added an active-operation heartbeat and safe heartbeat error handling.
  • Kept invocation finalization inside the FIFO lock and added regression coverage.
  • Prevented ownership release while a session claim or operation remains active.
  • Made doctor and status calls report ownership without acquiring it.
  • Corrected release, default-profile, toolset-default, and platform-isolation guidance.
  • Aligned marketplace descriptions and session setup instructions.
  • Resolved every Macroscope review thread.

@slate-rehm
slate-rehm merged commit 5c31e07 into dev Aug 8, 2026
6 checks passed
@slate-rehm
slate-rehm deleted the feature/stateless-single-session branch August 8, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant