Repository navigation
Description
Client or integration
Codex App (OpenCodex route; log shows wireClient: "ide").
Provider or upstream service
Kiro / claude-opus-5.5 (region: us-east-1).
OpenCodex version
2.94.0 (confirmed)
Operating system
- OS: Oracle Linux Server release 9.7
- Architecture:
aarch64(ARM64)
Environment
- OpenCodex:
2.94.0 - OS: Oracle Linux Server release 9.7 (
aarch64) - Client: Codex App (
wireClient: ide) - Provider/model: Kiro /
claude-opus-5.5(us-east-1)
Summary
With Advisor enabled, requests routed to Kiro fail immediately with invalid_request_error: The object can not be cloned. This happens even with a simple Hi prompt.
Disabling Advisor fixes the issue immediately with the same Kiro route/model. This appears to be an OpenCodex request-snapshot/Advisor interoperability bug, not a Kiro model or account error.
Steps to reproduce
- Configure an OpenCodex route using Kiro and
claude-opus-5.5. - Enable Advisor.
- Start a new Codex App session and send a simple prompt, e.g.
Hi. - Observe the clone error.
- Run
ocx advisor off(and restart OpenCodex if necessary), then retry the same Kiro route. - The request now succeeds.
Actual behavior
The client displays:
{
"error": {
"message": "The object can not be cloned.",
"type": "invalid_request_error",
"code": "invalid_request_error"
}
}The corresponding request diagnostic is:
[ocx:kiro:request] {"region":"us-east-1","requestedModel":"claude-opus-5.5","completionMode":"required","bodyBytes":112753,"messageCount":7,"toolCount":6,"hasProfileArn":true,"wireClient":"ide","hasPreviousResponseId":false}
Expected behavior
Kiro requests should complete normally when Advisor is enabled, or the adapter should handle Advisor-specific, non-cloneable request metadata without failing the entire request.
Likely root cause
The Kiro adapter snapshots the entire parsed request in buildRequest:
https://github.com/lidge-jun/opencodex/blob/main/src/adapters/kiro/adapter.ts
requestSnapshot = structuredClone(parsed);Advisor attaches a function to that same request object:
https://github.com/lidge-jun/opencodex/blob/main/src/advisor/runtime.ts
attachGuard: parsed => {
parsed._advisorGuard = createAdvisorGuard(plan);
},The _advisorGuard field is declared as a function in src/types/request.ts. Functions are not structured-cloneable. Thus, when the guard is attached before the Kiro adapter's snapshot, structuredClone(parsed) can throw a DataCloneError.
This matches both the exact error and the observed Advisor ON/OFF behavior. The precise exception stack has not yet been captured, so this is a strong source-backed hypothesis, not a runtime-confirmed stack trace.
Suggested fix / regression coverage
- Snapshot only the serializable fields needed by Kiro's fallback/rebuild path, or explicitly omit non-cloneable runtime-only fields like
_advisorGuardwhile preserving any required runtime behavior. - Add a Kiro adapter regression test where an Advisor-like function guard is attached to
OcxParsedRequest, and verifybuildRequestdoes not throw.
Workaround
ocx advisor offAfter disabling Advisor, claude-opus-5.5 through Kiro works again.
Activity
github-actions commentedon Oct 30, 2026
Issue reopened
The report now contains the information required by the automated check. Thanks for updating it.
lidge-jun commentedon Oct 30, 2026
Fixed on dev by #7981 (squash merge 4fc8700): the Kiro retry snapshot now excludes top-level runtime callbacks such as the Advisor guard, so Advisor-enabled Kiro requests no longer fail with DataCloneError, and the original request keeps its guard for delivery. It will ship in the next release.