Skip to content

fix: remove dead serializeState + normalize PATCH error responses#4076

Merged
aegis-gh-agent[bot] merged 1 commit into
developfrom
fix/audit-dead-code-patch-pattern
May 23, 2026
Merged

fix: remove dead serializeState + normalize PATCH error responses#4076
aegis-gh-agent[bot] merged 1 commit into
developfrom
fix/audit-dead-code-patch-pattern

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Audit cleanup (#4051 #4057 follow-ups)

Two small items from Argus audit:

1. Dead serializeState passthrough

src/services/acp/local-storage.ts:951 β€” serializeState() was just return serializeStateLightweight(state). Zero callers (not exported, not imported). Removed 6 lines.

2. PATCH error response normalization

src/routes/sessions.ts β€” PATCH /v1/sessions/:id used reply.code(400); return { error, code } pattern. All other routes use reply.status(400).send({ error, code }). Normalized to match.

Verification

tsc --noEmit β†’ 0 errors
npm test β†’ 5192 passed, 0 failed

 #4057 follow-ups)

Two audit cleanup items:

1. Remove dead serializeState() passthrough in local-storage.ts.
   Was just forwarding to serializeStateLightweight() with no callers.

2. Normalize PATCH /v1/sessions/:id error responses from
   reply.code() + return {} to reply.status().send() pattern
   matching all other routes.
Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… Approved β€” clean audit cleanup.

Review:

  1. Dead serializeState passthrough removed β€” zero callers, no impact. Correct.
  2. PATCH error responses normalized to reply.status(N).send({...}) β€” matches all other routes, behaviorally identical.

All 9 gates pass. CI green, 5192 tests, security scans clean, targets develop.

@aegis-gh-agent aegis-gh-agent Bot merged commit 7a88cd0 into develop May 23, 2026
18 checks passed
@aegis-gh-agent aegis-gh-agent Bot deleted the fix/audit-dead-code-patch-pattern branch May 23, 2026 07:51
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