Skip to content

refactor: guard dev server DELETE handler and fix port parsing#1001

Merged
jirispilka merged 1 commit into
masterfrom
fix/dev-server-cleanup
Jun 16, 2026
Merged

refactor: guard dev server DELETE handler and fix port parsing#1001
jirispilka merged 1 commit into
masterfrom
fix/dev-server-cleanup

Conversation

@jirispilka

Copy link
Copy Markdown
Collaborator

Minor fixes + cleanup to the dev/standby test server (src/dev_server.ts); does not affect the hosted server.

  • DELETE handler wrapped in try/catch (like POST/GET) — a rejection no longer crashes the process
  • PORT falls back to 3001 for empty/non-numeric values
  • error logged under the errMessage key; dead duplicate session-id injection removed; single-value enums inlined

🤖 Generated with Claude Code

Small fixes and cleanup to the dev/standby test server (src/dev_server.ts):
- wrap DELETE handleRequest in try/catch (like POST/GET) so a rejection
  no longer crashes the process
- PORT falls back to 3001 for empty or non-numeric values
- log under the errMessage key in the URL-parse softFail
- remove dead duplicate _meta.mcpSessionId injection
- inline single-value TransportType/Routes enums

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the t-ai Issues owned by the AI team. label Jun 16, 2026
Comment thread src/dev_server.ts
Comment on lines -129 to -133
// Inject session ID into request params for existing sessions
if (req.body?.params) {
req.body.params._meta ??= {};
req.body.params._meta.mcpSessionId = sessionId;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was duplicated, the session is inject below

Comment thread src/dev_server.ts
Comment on lines -26 to -33
enum TransportType {
HTTP = 'HTTP',
}

enum Routes {
MCP = '/',
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was really not worth keeping

@jirispilka jirispilka requested a review from MQ37 June 16, 2026 09:46
@jirispilka jirispilka changed the title fix: guard dev server DELETE handler and fix port parsing refactor: guard dev server DELETE handler and fix port parsing Jun 16, 2026
@jirispilka jirispilka merged commit ec3ccfe into master Jun 16, 2026
12 checks passed
@jirispilka jirispilka deleted the fix/dev-server-cleanup branch June 16, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants