multiagentv2

package
v8.0.70 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CodexMultiAgentV2ToolsPreparedContextKey = "codex_multi_agent_v2_tools_prepared"

CodexMultiAgentV2ToolsPreparedContextKey marks a request whose collaboration tool definitions were prepared at the Responses API boundary.

Variables

This section is empty.

Functions

func HasCodexMultiAgentV2NamespaceConflict

func HasCodexMultiAgentV2NamespaceConflict(payload []byte) bool

HasCodexMultiAgentV2NamespaceConflict reports whether the request defines the reserved optimized namespace, which must remain untouched.

func HasCodexMultiAgentV2NamespaceConflictDoc added in v8.0.52

func HasCodexMultiAgentV2NamespaceConflictDoc(doc *ojson.Doc) bool

HasCodexMultiAgentV2NamespaceConflictDoc reports whether doc defines the reserved optimized namespace, which must remain untouched.

func IsCodexClientUserAgent

func IsCodexClientUserAgent(userAgent string) bool

IsCodexClientUserAgent reports whether a request uses an official Codex client identity.

func OptimizeCodexMultiAgentV2Request

func OptimizeCodexMultiAgentV2Request(ctx context.Context, headers http.Header, payload []byte, cfg *config.Config) ([]byte, bool)

OptimizeCodexMultiAgentV2Request rewrites an eligible spawn_agent request and reports whether the collaboration namespace was renamed for upstream use.

func OptimizeCodexMultiAgentV2RequestDoc added in v8.0.52

func OptimizeCodexMultiAgentV2RequestDoc(doc *ojson.Doc, ctx context.Context, headers http.Header, cfg *config.Config) bool

OptimizeCodexMultiAgentV2RequestDoc rewrites an eligible spawn_agent request in doc and reports whether the collaboration namespace was renamed for upstream use.

func PrepareCodexMultiAgentV2Tools

func PrepareCodexMultiAgentV2Tools(ctx context.Context, headers http.Header, payload []byte, enabled, homeEnabled bool) ([]byte, bool)

PrepareCodexMultiAgentV2Tools prepares collaboration tool definitions at the Responses API boundary without changing the collaboration namespace.

func PrepareCodexMultiAgentV2ToolsDoc added in v8.0.52

func PrepareCodexMultiAgentV2ToolsDoc(doc *ojson.Doc, ctx context.Context, headers http.Header, enabled, homeEnabled bool) (bool, bool)

PrepareCodexMultiAgentV2ToolsDoc prepares collaboration tool definitions in doc at the Responses API boundary without changing the collaboration namespace.

func RestoreCodexMultiAgentV2Response

func RestoreCodexMultiAgentV2Response(payload []byte, optimized bool) []byte

RestoreCodexMultiAgentV2Response restores optimized collaboration namespace values before an upstream response is translated and returned to the client.

func RewriteCodexMultiAgentV2Input

func RewriteCodexMultiAgentV2Input(ctx context.Context, headers http.Header, payload []byte, cfg *config.Config, isCompat ...bool) []byte

RewriteCodexMultiAgentV2Input converts official Codex multi-agent input into standard Responses API messages when multi-agent v2 optimization or model compatibility mode is enabled. When isCompat is true, it converts agent_message items to portable message/user input and proactively removes non-standard metadata fields (author, recipient, internal_chat_message_metadata_passthrough).

func RewriteCodexMultiAgentV2InputDoc added in v8.0.52

func RewriteCodexMultiAgentV2InputDoc(doc *ojson.Doc, ctx context.Context, headers http.Header, cfg *config.Config, isCompat ...bool) bool

RewriteCodexMultiAgentV2InputDoc converts official Codex multi-agent input in doc into standard Responses API messages in place.

func RewriteCodexOrphanDelegationInput

func RewriteCodexOrphanDelegationInput(ctx context.Context, headers http.Header, payload []byte, enabled bool) []byte

RewriteCodexOrphanDelegationInput converts orphan Codex delegation outputs into standard user messages when orphan delegation compatibility is enabled and the request carries the X-Openai-Subagent: collab_spawn header.

func RewriteCodexOrphanDelegationInputDoc added in v8.0.52

func RewriteCodexOrphanDelegationInputDoc(doc *ojson.Doc, ctx context.Context, headers http.Header, enabled bool) bool

RewriteCodexOrphanDelegationInputDoc converts orphan Codex delegation outputs in doc into standard user messages in place.

func RewriteCodexOrphanDelegationInputForConfig

func RewriteCodexOrphanDelegationInputForConfig(ctx context.Context, headers http.Header, payload []byte, cfg *config.Config) []byte

RewriteCodexOrphanDelegationInputForConfig applies RewriteCodexOrphanDelegationInput based on cfg.Codex.OrphanDelegationCompatibility and the X-Openai-Subagent header.

func RewriteCodexOrphanDelegationInputForConfigDoc added in v8.0.52

func RewriteCodexOrphanDelegationInputForConfigDoc(doc *ojson.Doc, ctx context.Context, headers http.Header, cfg *config.Config) bool

RewriteCodexOrphanDelegationInputForConfigDoc applies RewriteCodexOrphanDelegationInputDoc in place on doc based on cfg.Codex.OrphanDelegationCompatibility and the X-Openai-Subagent header.

func RewriteCodexSpawnAgentDescription

func RewriteCodexSpawnAgentDescription(ctx context.Context, headers http.Header, payload []byte, cfg *config.Config) []byte

RewriteCodexSpawnAgentDescription optimizes spawn_agent definitions for official Codex clients when multi-agent v2 optimization is enabled.

func TranslateRequestEnvelopeWithCodexMultiAgentV2

func TranslateRequestEnvelopeWithCodexMultiAgentV2(ctx context.Context, headers http.Header, cfg *config.Config, from, to sdktranslator.Format, req sdktranslator.RequestEnvelope) sdktranslator.RequestEnvelope

TranslateRequestEnvelopeWithCodexMultiAgentV2 normalizes official Codex multi-agent input while preserving request-scoped translation metadata.

func TranslateRequestWithCodexMultiAgentV2

func TranslateRequestWithCodexMultiAgentV2(ctx context.Context, headers http.Header, cfg *config.Config, from, to sdktranslator.Format, model string, payload []byte, stream bool) []byte

TranslateRequestWithCodexMultiAgentV2 normalizes official Codex multi-agent input before translating it to a non-Codex target protocol.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL