Skip to content

refactor(agent): remove redundant 'lock' command (keep only 'stop') - #135

Merged
arimxyer merged 1 commit into
mainfrom
refactor/remove-redundant-lock-command
Jul 1, 2026
Merged

refactor(agent): remove redundant 'lock' command (keep only 'stop')#135
arimxyer merged 1 commit into
mainfrom
refactor/remove-redundant-lock-command

Conversation

@arimxyer

@arimxyer arimxyer commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Per your call: lock and stop had become identical (both zero the resident secrets and stop the agent), so keeping two commands for one action was just confusing. This removes lock entirely — pass-cli agent stop is the single verb.

Removed

  • The top-level pass-cli lock and pass-cli agent lock commands (cmd/lock.go deleted).
  • The now-dead MethodLock protocol method and the client LockAgent().

Unchanged

  • Internal auto-lock (idle/max-TTL) and the prompt-stop behavior: MethodShutdown still zeroes secrets via lockLocked, and serve.go still frees the socket promptly when the agent locks.
  • So agent stop behaves exactly as lock did: zero secrets, stop, free the socket, next command falls back to direct-open.

Tests

  • Unit tests that used MethodLock to lock the agent now use MethodShutdown (identical at the Agent level).
  • The LockThenFallback integration test folds into StopThenFallback, which now also asserts the socket is freed promptly.
  • All agent unit + integration tests pass; lint clean on linux/darwin; builds on windows.

🤖 Generated with Claude Code

lock and stop had become identical (both zero the resident secrets and stop the
agent), so having two commands for one action was just confusing. Remove lock
entirely — the top-level 'pass-cli lock' and 'pass-cli agent lock', plus the
now-dead MethodLock RPC and client LockAgent(). 'pass-cli agent stop' is the sole
way to stop a running agent.

Internal auto-lock (idle/max-TTL) and the serve.go 'stop when locked' behavior are
unchanged — MethodShutdown still zeroes secrets via lockLocked, and the socket is
still freed promptly. Unit tests that used MethodLock to lock the agent now use
MethodShutdown (identical at the Agent level); the LockThenFallback integration
test folds into StopThenFallback (which now asserts the socket is freed promptly).

All agent unit + integration tests pass; lint clean on linux/darwin; builds on
windows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kVLjbUL4F4CkoA7RbMYy8
@arimxyer
arimxyer merged commit c16d8a0 into main Jul 1, 2026
11 checks passed
@arimxyer
arimxyer deleted the refactor/remove-redundant-lock-command branch July 1, 2026 18:23
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