fix: batch config wiring quick wins (#262-#266)#267
Merged
Conversation
Five post-PR-261 fixes to close config wiring gaps: - Deprecate with_provider/with_provider_and_path bypass constructors (#262) - Wire on_compaction callback for TUI status feedback (#264) - Extract build_system_prompt_from_config for -P mode parity (#266) - Wire dangerousPatterns config through to tool confirmation (#263) - Cache running_char_count to avoid re-serializing JSON per iteration (#265) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Member
Author
Self-ReviewBuild & Tests
Fix-by-fix verification#262 — Deprecate bypass constructors
#264 — Wire on_compaction callback
#266 — Fix -P mode system prompt
#263 — Wire dangerousPatterns
#265 — Cache running char count
Review findings addressed during PR
No issues found. Ready to merge. |
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
Five quick fixes to close gaps left after PR #261's config wiring:
with_provider()/with_provider_and_path()constructors that bypass config. Added#[deprecated]attributes pointing to the correctwith_project_path()+set_config()+set_provider()pattern.on_compactioncallback so the TUI displays "Compacting context..." / "Context compacted" status messages. AddedCompaction(bool)variant toAppEvent.build_system_prompt_from_config()as a standalone public function and use it in-Pnon-interactive mode, so config-drivensystemPromptAdditionsandprojectContextare applied consistently.dangerousPatternsconfig through to tool confirmation. Addeddangerous_patternsfield toAgentConfig,matches_dangerous_pattern()method, and unifiedmaybe_confirm()that checks both built-in destructive tools and custom patterns in a single pass.running_char_countonAgentStateto avoid re-serializing all message JSON on every iteration of the agent loop. Incremented on each message push, recalculated after compaction.Files changed (6)
codi-rs/src/tui/app.rscodi-rs/src/tui/mod.rscodi-rs/src/main.rscodi-rs/src/agent/types.rscodi-rs/src/agent/mod.rscodi-rs/src/orchestrate/child_agent.rsTest plan
cargo build— clean, zero warningscargo test— 463 tests pass (7 new)test_dangerous_pattern_match,test_dangerous_pattern_empty,test_dangerous_pattern_invalid_regex_skipped,test_agent_state_default_running_char_count,test_build_system_prompt_from_config_none,test_build_system_prompt_from_config_with_additions,test_app_event_compaction_variantReview notes
maybe_confirm()replaces the oldshould_confirm()+confirm_tool()two-method pattern to avoid double-serializing tool input JSONdangerousPatternsconfig emit atracing::warn!rather than silently skippingmessages_mut()is a known escape hatch that bypassesrunning_char_count— no current callers, but noted for future awareness🤖 Generated with Claude Code