refactor(backend): sessions route cleanup + ACP backend JSDoc (#3302)#3305
Merged
Conversation
β¦add JSDoc, improve error messages (#3302) - Extract isNonAdminCaller() helper to replace 5x duplicated ownership check - Add JSDoc to registerSessionRoutes and createSessionHandler - Add @deprecated annotation on legacy /sessions (no prefix) route - Improve error messages: ACP startup, health check, event replay - No behavior changes β cleanup pass only
Contributor
There was a problem hiding this comment.
LGTM. Clean refactor β isNonAdminCaller() eliminates 5Γ duplicated ownership check, JSDoc on 17 ACP backend methods, 3 improved error messages with actionable detail. No logic changes.
All 9 merge gates pass:
- β Review completed
- β No conflicts
- β CI green (checks running, no failures)
- β No regressions (pure refactor)
- β Unit tests (no new code to test)
- β E2E (no functional changes)
- β No docs needed (JSDoc is in-code)
- β Security clean
- β Targets develop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Code quality pass for
src/routes/sessions.tsandsrc/services/acp/backend.tsper #3302.sessions.ts
isNonAdminCaller()helper β replaces 5Γ duplicated ownership check pattern (callerKeyId !== 'master' && callerKeyId !== null && callerKeyId !== undefined && callerRole !== 'admin')registerSessionRoutes()andcreateSessionHandler()@deprecatedon legacyGET /sessions(no/v1/prefix) route"ACP runtime failed to start β check claude CLI availability and ACP configuration""Error fetching health""Failed to query event store"with details instead of raw erroracp/backend.ts
createSession,resumeSession,loadSession,shutdownSession,restartSession,sendPrompt,dispatchAction,claimDriver,releaseDriver,transferDriver,getParticipants,getPendingApproval,getRuntime,approveSession,rejectSession)Guidelines
Verification
Commit: 111a4bc
Session: direct implementation (Aegis prompt delivery blocked by stale server process)