Repository navigation
refactor(cli): reorder functions and tests top-down by behavior - #1226
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure function and test reordering cleanup across
crates/ox/with zero behavior changes, following top-down caller-to-callee ordering and grouping tests by behavior with normal cases before error cases:crates/ox/src/lib.rs: alphabetizeCommandvariants (Acp,Chat,Complete,Mcp,Run,Sessions) and mirror that order inrun(),dispatch(), subcommand enums, and command helpers.crates/ox/src/mcp.rs: order functions top-down (resolve_socket_path,run_mcp_list,run_mcp_call,parse_tool_arguments,send_rpc_request).crates/ox/src/runtime.rs: place entrypoints (resolve_reasoning_effort,resolve_provider,resolve_provider_with_default,resolve_runtime_from_config) above their private helpers, groupresolve_tui_presettests next toresolve_themetests, placeresolve_provider_reports_config_and_lookup_errorsafter normalresolve_provider*tests, and moveassert_clamped_effortsto the bottom helper block.crates/ox/src/workspace.rsandcrates/ox/src/workspace/plugins.rs: placeassemble_agentaboveassemble_agent_with_plugins, and order plugin wiring top-down (build_tools_and_plugins,spawn_plugins_and_hooks,spawn_plugins,shutdown_plugins,build_tool_registry).crates/ox/src/headless.rs: placerender_agent_streamaboveStreamRendererwithensure_newlinebelowhandle_event, grouprun_agent_with_io_sends_loaded_attachments_in_user_messagewith therun_agent_with_io_*tests, and placerender_agent_stream_reports_compaction_to_stderrbeforerender_agent_stream_handles_error_and_unexpected_close.crates/ox/src/interactive.rs: placerun_acpaboveAcpSessionFactory, and placeopen_state_store_gracefullyin call order underbuild_chat_agent_with_default_config.crates/ox/tests/cli_run.rs: movelist_session_idsto the top helper block and grouprun_no_session_does_not_create_session_dbnext torun_session_lifecycle.Test plan
nix develop -c run-hookspassed (format, spelling, and Clippy across all targets).cargo test -p oxpassed (60 unit tests and 14 integration tests acrosscli,cli_acp,cli_run, andmcp_cli).