-
Notifications
You must be signed in to change notification settings - Fork 0
Lessons
licco edited this page Aug 2, 2026
·
1 revision
Local-only knowledge base. Aggregates problems 鈫?root causes 鈫?solutions from
DEVLOG.md. Intentionally not tracked by git (configured via.git/info/exclude, never via.gitignore).
Conventions:
- Grouped by category (
## <Category>), newest lesson at the top of each. - Entry format: Problem / Root cause / Solution / How to avoid / Related.
- Slugs are stable IDs 鈥?never rename an old slug, only add "Superseded by".
See .trae/skills/devlog/references/categories.md for the canonical category list.
-
Problem: Trae IDE reported
mcp error: command error: invalid type: string "REQUEST_TIMEOUT", expected i32 at line 1 column 80when anssh_executecall timed out, giving no useful information about where the timeout occurred. -
Root cause: Trae's Rust MCP client generates a JSON-RPC error whose
codeis the string"REQUEST_TIMEOUT"on timeout, violating the JSON-RPC spec that requireserror.codeto be an integer. The installedmcpPython SDK (1.27.1) does serializehttpx.codes.REQUEST_TIMEOUTas integer408, so the malformed response originates from the client side, not our server. - Solution: Add server-side timeout and heartbeat logs so the real hang point can be identified independently of the client's broken error message.
-
How to avoid: For long-running tool calls, always log
[cmd-start], periodic[cmd-heartbeat], and[cmd-done]/[cmd-timeout]/[cmd-error]events around the blocking SSH execution. Do not rely solely on MCP client error messages for timeout diagnosis. -
Related:
- DEVLOG.md →
## [2026-07-20] Add execution timeout and heartbeat logging
- DEVLOG.md →
-
Problem: The
ssh_connectMCP tool's optionalcommandparameter executed arbitrary commands without any security validation, audit logging, or dangerous-command confirmation — a complete bypass of the security framework. -
Root cause: The
commandparameter was added as a convenience feature before the security framework existed. When the security framework was later added tossh_execute(_handle_execute), the parallel path in_handle_connectwas overlooked. MCP tools with multiple parameters can hide execution paths that bypass the main handler. -
Solution: Add
command_validator.validate_command()before every command execution, regardless of which MCP tool handler triggers it. Log blocked attempts to the audit trail. Connection success should still be returned even when the command is blocked. -
How to avoid: When adding a new parameter to an existing MCP tool that
can execute commands, always route the execution through the same validation
path. Review all
session.execute_command()call sites for security gaps. -
Related:
- DEVLOG.md →
## [2026-06-28] Fix ssh_connect command bypassing security validation
- DEVLOG.md →
(to be generated once the file has more than ~10 lessons)