Skip to content

refactor(mcp-server): add injectable clock for session expiry#131

Merged
bug-ops merged 1 commit into
masterfrom
mcp-server-session-expiry-has
Jul 9, 2026
Merged

refactor(mcp-server): add injectable clock for session expiry#131
bug-ops merged 1 commit into
masterfrom
mcp-server-session-expiry-has

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

This is a behavior-preserving refactor: SystemClock::now() is a pure passthrough to Utc::now(), and production expiry semantics are unchanged.

Closes #121

Test plan

  • cargo +nightly fmt --check
  • cargo +stable clippy --all-targets --all-features --workspace -- -D warnings
  • cargo nextest run --all-features --workspace --no-fail-fast (664/664 passed)
  • cargo test --doc --all-features --workspace (182/182 passed)

@github-actions github-actions Bot added area: cli CLI commands and interface area: bridge MCP bridge and integration crate: mcp-cli Changes to mcp-cli crate (command-line interface) type: documentation Documentation changes (*.md, docs/, comments) breaking change Contains breaking API changes (requires major version bump) release Release preparation (changelog, version bumps) labels Jul 9, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 9, 2026 15:12
Replace direct Utc::now() calls in PendingGeneration with a Clock
trait (SystemClock in production, TestClock in tests), threaded
through StateManager and GeneratorService via Arc<dyn Clock>. Tests
now inject a fake clock to exercise the 30-minute TTL boundary
precisely instead of rewinding expires_at after construction.

Also files follow-up issues for three previously untracked TODO
markers (#124, #125, #126) and updates the comments to reference
them.

Closes #121
@bug-ops
bug-ops force-pushed the mcp-server-session-expiry-has branch from 1396318 to 004380f Compare July 9, 2026 15:14
@bug-ops
bug-ops merged commit 878c2a6 into master Jul 9, 2026
17 checks passed
@bug-ops
bug-ops deleted the mcp-server-session-expiry-has branch July 9, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: bridge MCP bridge and integration area: cli CLI commands and interface breaking change Contains breaking API changes (requires major version bump) crate: mcp-cli Changes to mcp-cli crate (command-line interface) release Release preparation (changelog, version bumps) type: documentation Documentation changes (*.md, docs/, comments)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp-server: session expiry has no injectable clock; scattered TODO markers lack tracking issues

1 participant