feat: add --agent/--model/--session CLI startup commands - #2129
Open
xielixing wants to merge 1 commit into
Open
Conversation
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
Adds
--agent,--model, and--sessionCLI startup commands to the BitFun desktop app, enabling users to launch the app pre-configured with a specific agent type, model, and/or session to restore.Closes #2095
Changes
Rust (desktop app)
src/apps/desktop/src/lib.rs: AddedStartupCommandstruct andparse_startup_command()function. Therun()method calls it at startup and passes the parsed command through.setup()tocreate_main_window.src/apps/desktop/src/appearance.rs:generate_init_scriptandcreate_main_windowaccept an optionalstartup_commandparameter. Injectswindow.__BITFUN_STARTUP_COMMAND__as a JSON constant (4KB max).TypeScript (web-ui)
src/web-ui/src/shared/types/global-state.ts: AddedStartupCommandinterface,consumeBootstrapStartupCommand()one-shot reader, andgetStartupCommand()in theglobalStateAPIexport.src/web-ui/src/flow_chat/hooks/useFlowChat.ts:createSessionnow consumes startup command overrides:--agent: overrides the agent type for the first session--model: overrides the model name for the first session--session: tries to restore an existing session by ID before creating a new one (falls back to new session creation if not found)Usage
Validation
tsc --noEmitpassescargo check -p bitfun-desktoppassescargo test -p bitfun-desktop appearance::tests— 3/3 passed