From ac221867f61325514184d4d9792c7e47ca6e61a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 21:21:16 +0000 Subject: [PATCH 1/2] Initial plan From e67e8a9e184079b7b4f705d28e7b3b2f27d9f5fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 21:49:24 +0000 Subject: [PATCH 2/2] Changes before error encountered Co-authored-by: KSemenenko <4385716+KSemenenko@users.noreply.github.com> --- CodexSharpSDK.Tests/Unit/CodexExecTests.cs | 8 +-- .../Unit/CodexFeatureKeysTests.cs | 46 ++++++++++++++++ CodexSharpSDK/Models/CodexFeatureKeys.cs | 54 +++++++++++++++++++ submodules/openai-codex | 2 +- 4 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 CodexSharpSDK.Tests/Unit/CodexFeatureKeysTests.cs create mode 100644 CodexSharpSDK/Models/CodexFeatureKeys.cs diff --git a/CodexSharpSDK.Tests/Unit/CodexExecTests.cs b/CodexSharpSDK.Tests/Unit/CodexExecTests.cs index 7929895..95c8e2f 100644 --- a/CodexSharpSDK.Tests/Unit/CodexExecTests.cs +++ b/CodexSharpSDK.Tests/Unit/CodexExecTests.cs @@ -128,8 +128,8 @@ public async Task BuildCommandArgs_MapsExtendedCliFlags() Color = ExecOutputColor.Never, ProgressCursor = true, OutputLastMessageFile = "/tmp/last-message.txt", - EnabledFeatures = ["multi_agent", "unified_exec"], - DisabledFeatures = ["steer"], + EnabledFeatures = [CodexFeatureKeys.MultiAgent, CodexFeatureKeys.UnifiedExec], + DisabledFeatures = [CodexFeatureKeys.Steer], AdditionalCliArguments = ["--some-future-flag", "custom-value"], }); @@ -144,8 +144,8 @@ public async Task BuildCommandArgs_MapsExtendedCliFlags() await Assert.That(commandArgs.Contains("--ephemeral")).IsTrue(); await Assert.That(commandArgs.Contains("--progress-cursor")).IsTrue(); - await Assert.That(CollectFlagValues(commandArgs, "--enable")).IsEquivalentTo(["multi_agent", "unified_exec"]); - await Assert.That(CollectFlagValues(commandArgs, "--disable")).IsEquivalentTo(["steer"]); + await Assert.That(CollectFlagValues(commandArgs, "--enable")).IsEquivalentTo([CodexFeatureKeys.MultiAgent, CodexFeatureKeys.UnifiedExec]); + await Assert.That(CollectFlagValues(commandArgs, "--disable")).IsEquivalentTo([CodexFeatureKeys.Steer]); await Assert.That(commandArgs.Contains("--some-future-flag")).IsTrue(); await Assert.That(commandArgs.Contains("custom-value")).IsTrue(); diff --git a/CodexSharpSDK.Tests/Unit/CodexFeatureKeysTests.cs b/CodexSharpSDK.Tests/Unit/CodexFeatureKeysTests.cs new file mode 100644 index 0000000..ccc6fbc --- /dev/null +++ b/CodexSharpSDK.Tests/Unit/CodexFeatureKeysTests.cs @@ -0,0 +1,46 @@ +using System.Reflection; +using ManagedCode.CodexSharpSDK.Models; + +namespace ManagedCode.CodexSharpSDK.Tests.Unit; + +public class CodexFeatureKeysTests +{ + [Test] + public async Task ToolCallMcpElicitation_HasCorrectValue() + { + var key = CodexFeatureKeys.ToolCallMcpElicitation; + await Assert.That(key).IsEqualTo("tool_call_mcp_elicitation"); + } + + [Test] + public async Task AllFeatureKeys_AreNonEmptyStrings() + { + var keys = GetAllFeatureKeyValues(); + foreach (var key in keys) + { + await Assert.That(string.IsNullOrWhiteSpace(key)).IsFalse(); + } + } + + [Test] + public async Task AllFeatureKeys_AreUnique() + { + var keys = GetAllFeatureKeyValues(); + var duplicates = keys + .GroupBy(k => k, StringComparer.Ordinal) + .Where(g => g.Count() > 1) + .Select(g => g.Key) + .ToArray(); + + await Assert.That(duplicates).IsEmpty(); + } + + private static string[] GetAllFeatureKeyValues() + { + return typeof(CodexFeatureKeys) + .GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly) + .Where(field => field is { IsLiteral: true, IsInitOnly: false, FieldType: not null } && field.FieldType == typeof(string)) + .Select(field => (string)field.GetRawConstantValue()!) + .ToArray(); + } +} diff --git a/CodexSharpSDK/Models/CodexFeatureKeys.cs b/CodexSharpSDK/Models/CodexFeatureKeys.cs new file mode 100644 index 0000000..588521e --- /dev/null +++ b/CodexSharpSDK/Models/CodexFeatureKeys.cs @@ -0,0 +1,54 @@ +namespace ManagedCode.CodexSharpSDK.Models; + +/// +/// Known Codex CLI feature flag keys for use with +/// and . +/// Keys are sourced from codex-rs/core/src/features.rs in the upstream openai/codex repository. +/// +public static class CodexFeatureKeys +{ + public const string Undo = "undo"; + public const string ShellTool = "shell_tool"; + public const string UnifiedExec = "unified_exec"; + public const string ShellZshFork = "shell_zsh_fork"; + public const string ShellSnapshot = "shell_snapshot"; + public const string JsRepl = "js_repl"; + public const string JsReplToolsOnly = "js_repl_tools_only"; + public const string WebSearchRequest = "web_search_request"; + public const string WebSearchCached = "web_search_cached"; + public const string SearchTool = "search_tool"; + public const string CodexGitCommit = "codex_git_commit"; + public const string RuntimeMetrics = "runtime_metrics"; + public const string Sqlite = "sqlite"; + public const string Memories = "memories"; + public const string ChildAgentsMd = "child_agents_md"; + public const string ImageDetailOriginal = "image_detail_original"; + public const string ApplyPatchFreeform = "apply_patch_freeform"; + public const string RequestPermissions = "request_permissions"; + public const string UseLinuxSandboxBwrap = "use_linux_sandbox_bwrap"; + public const string RequestRule = "request_rule"; + public const string ExperimentalWindowsSandbox = "experimental_windows_sandbox"; + public const string ElevatedWindowsSandbox = "elevated_windows_sandbox"; + public const string RemoteModels = "remote_models"; + public const string PowershellUtf8 = "powershell_utf8"; + public const string EnableRequestCompression = "enable_request_compression"; + public const string MultiAgent = "multi_agent"; + public const string Apps = "apps"; + public const string Plugins = "plugins"; + public const string ImageGeneration = "image_generation"; + public const string AppsMcpGateway = "apps_mcp_gateway"; + public const string SkillMcpDependencyInstall = "skill_mcp_dependency_install"; + public const string SkillEnvVarDependencyPrompt = "skill_env_var_dependency_prompt"; + public const string Steer = "steer"; + public const string DefaultModeRequestUserInput = "default_mode_request_user_input"; + public const string CollaborationModes = "collaboration_modes"; + public const string ToolCallMcpElicitation = "tool_call_mcp_elicitation"; + public const string Personality = "personality"; + public const string Artifact = "artifact"; + public const string FastMode = "fast_mode"; + public const string VoiceTranscription = "voice_transcription"; + public const string RealtimeConversation = "realtime_conversation"; + public const string PreventIdleSleep = "prevent_idle_sleep"; + public const string ResponsesWebsockets = "responses_websockets"; + public const string ResponsesWebsocketsV2 = "responses_websockets_v2"; +} diff --git a/submodules/openai-codex b/submodules/openai-codex index 6638558..4b4f61d 160000 --- a/submodules/openai-codex +++ b/submodules/openai-codex @@ -1 +1 @@ -Subproject commit 6638558b8807328e852b54580b010be7034699b7 +Subproject commit 4b4f61d37965b7a37ef1462f7dc5aa927618c9ae