refactor(mode): replace config-based mode setting with runtime detection#196
Open
ayeshurun wants to merge 10 commits intomicrosoft:mainfrom
Open
refactor(mode): replace config-based mode setting with runtime detection#196ayeshurun wants to merge 10 commits intomicrosoft:mainfrom
ayeshurun wants to merge 10 commits intomicrosoft:mainfrom
Conversation
This script benchmarks the startup performance of the CLI by measuring module import times, CLI invocation times, and heavy dependency loading. It allows comparisons against a baseline branch or tag.
Co-authored-by: ayeshurun <98805507+ayeshurun@users.noreply.github.com>
- Move runtime mode into Context class (singleton instance methods) - Graduated deprecation: 'config set mode interactive' still launches REPL with warning - Graduated deprecation: 'config get mode' returns runtime mode with warning - Add regression tests: runtime mode (6), config deprecation (7), init defaults (4), MAP removal (6), session-per-request (3), context persistence mock updates (10) - Consolidate test files into test_fab_context.py, test_config.py, test_fab_state_config.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolved conflicts in main.py and test_fab_state_config.py. Re-removed ItemType.MAP, _shared_session/_get_session, and MAP references in command_support.yaml, fab_item.py, and test conftest that upstream re-introduced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
📥 Pull Request
✨ Description of new changes
The CLI mode (
interactive/command_line) was persisted in~/.config/fab/config.jsonand requiredfab config set mode interactiveto enter REPL. Mode is now determined purely at runtime — no config entry, no explicit switching.What changed
Runtime detection —
fab_constantexposesset_runtime_mode()/get_runtime_mode().InteractiveCLIsetsFAB_MODE_INTERACTIVEon start and resets it on exit. Everything else readsget_runtime_mode()instead of the config file.Config migration —
init_defaults()silently removes the legacymodekey from existingconfig.jsonon first run.Backward compat —
config get modeandconfig set mode <value>now print a deprecation warning and return cleanly instead of erroring.Context persistence —
_should_use_context_file()now callsget_runtime_mode()instead offab_state_config.get_config(FAB_MODE). Context files are still skipped in REPL (in-memory context is sufficient).main.py— removed the post-login block that auto-started REPL whenmode=interactivewas stored in config.Docs —
modes.mdrewritten to reflect the new runtime model;moderow removed fromsettings.md.Entry points now
fabfab <command>Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.