Skip to content

chore(gastown): remove manual request logging middleware#3152

Closed
jrf0110 wants to merge 1 commit intomainfrom
chore/gastown-remove-manual-request-logging
Closed

chore(gastown): remove manual request logging middleware#3152
jrf0110 wants to merge 1 commit intomainfrom
chore/gastown-remove-manual-request-logging

Conversation

@jrf0110
Copy link
Copy Markdown
Contributor

@jrf0110 jrf0110 commented May 9, 2026

Summary

Remove the redundant request-logging middleware from gastown.worker.ts. This middleware logged every HTTP request twice (incoming --> and outgoing <--) via logger.info(), duplicating the structured AE events already emitted by the per-route instrumented() wrapper in analytics.middleware.ts.

Removed:

  • import { logger } from './util/log.util' (now unused at the worker level)
  • The entire request-logging middleware block: URL regex constants (RE_ORG, RE_TOWN, RE_RIG, RE_AGENT), the logger.setTags() call, and both logger.info() lines

Preserved:

  • timingMiddleware — still captures requestStartTime for instrumented() to compute durationMs
  • useWorkersLogger('gastown-worker') — still establishes AsyncLocalStorage context for log enrichment
  • Auth middleware setTags calls for orgId and userId — still tag downstream logger.* calls

Verification

Diff: 30 lines deleted, 0 added, only services/gastown/src/gastown.worker.ts modified.

Visual Changes

N/A

Reviewer Notes

The removed logger.setTags was only consumed by the two logger.info lines being removed. Auth middleware continues to set orgId/userId tags from JWT claims. Town.do.ts runs in a separate isolate and has its own setTags calls.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 9, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

This is a straightforward, safe deletion. The removed middleware was indeed redundant:

  • logger import is now fully unused (no remaining references in gastown.worker.ts)
  • Auth middleware setTags calls for orgId (in org-auth.middleware.ts) and userId (in kilo-auth.middleware.ts) remain intact
  • instrumented() already captures townId, rigId, agentId, beadId from Hono's matched route params and emits them as structured AE events — the regex-based path extraction was indeed duplicating this
  • timingMiddleware and useWorkersLogger are preserved

Latest commit added only a blank line — no functional change.

Files Reviewed (1 file)
  • services/gastown/src/gastown.worker.ts — 0 issues

Reviewed by claude-4.6-sonnet-20260217 · 146,035 tokens

@jrf0110 jrf0110 force-pushed the chore/gastown-remove-manual-request-logging branch 2 times, most recently from 162dd96 to 62a655f Compare May 9, 2026 22:10
@jrf0110 jrf0110 force-pushed the chore/gastown-remove-manual-request-logging branch from 62a655f to 27be16a Compare May 9, 2026 22:26
@jrf0110
Copy link
Copy Markdown
Contributor Author

jrf0110 commented May 10, 2026

Superseded by #3158. Closing as duplicate from convoy retry loop.

@jrf0110 jrf0110 closed this May 10, 2026
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