Maintain, debug, and recover MTGA's Trae native custom-model route. Use when Trae native integration fails, Trae updates shift ai_agent.dll hook offsets, errors such as 4028/4054/429 appear, native rewriter or SseOpenPayload URL rewriting needs diagnosis, or Codex needs to avoid repeating prior renderer-JS/private-protocol dead ends.
79
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
ai_agent.dll, not renderer JS.python-src/modules/trae_patch/ and service glue in python-src/modules/services/trae_native_route.py.python-src/scripts/trae_patch/ for repro, CDP triggering, and maintenance probes only. Do not move runtime-required code back into scripts.reqwest.Classify the failure before changing code.
4028: generic Trae custom-model failure. It can mean auth, unreachable local service, wrong URL, 4xx, or malformed response.4054: usually means Trae's native/custom-model tunnel path rejected or could not consume the stream; prior private protocol hand-roll attempts hit this.429: usually caused by repeated live upstream probes or duplicate requests; throttle and inspect request counts before blaming auth.Confirm which path is under test.
127.0.0.1:18083, and run the native rewriter.ProxyApp.apply_runtime_config().Reproduce with the smallest useful surface.
uv run python -m modules.trae_patch.trae_native_sse_open_url_rewriter --helpscripts/trae_patch/trae_native_byte_pattern.py with the known URL-copy pattern.scripts/trae_patch/trae_native_custom_model_session.py.scripts/trae_patch/trae_cdp_send_chat.py.If Trae updated or offsets moved, read references/update-recovery.md.
If unsure why a prior approach is rejected, read references/native-route-map.md before creating new probes.
CustomModelProxyManager -> official custom-model WebSocket tunnel -> SSE instruction -> reqwest -> user base_url.BootConfig, MNI channel interception, and hand-built JS/internal events were negative or higher-maintenance routes.48 8b 52 08 4d 8b 46 10 48 8d 8d 20 01 00 00; the call offset used by the rewriter is 0x0F.references/native-route-map.md: architecture, file map, and prior dead ends.references/update-recovery.md: procedure for recovering after Trae version changes or breakpoint drift.72669fb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.