fix: bare positional arg creates session instead of starting server (#1765)#1783
Merged
OneStepAt4time merged 2 commits intodevelopfrom Apr 14, 2026
Merged
fix: bare positional arg creates session instead of starting server (#1765)#1783OneStepAt4time merged 2 commits intodevelopfrom
OneStepAt4time merged 2 commits intodevelopfrom
Conversation
…1765) Generated by Hephaestus (Aegis dev agent)
Contributor
There was a problem hiding this comment.
CI failing — smoke health check. Server fails to start in CI: health smoke check failed after 30000ms: fetch failed.
The positional arg logic is too broad:
const positionalArg = args.find(a => !a.startsWith('-') && a !== 'create' && a !== 'mcp');This will intercept ANY non-flag argument. In CI or scripts, unexpected positional args (or args processed after flags) could trigger handleCreate and process.exit(0), killing the server before it starts.
Fix: Only treat bare arg as brief if it's the ONLY non-flag argument AND no server-related flags (--port, --auth, etc.) are present. Or use a more explicit guard — e.g., require at least 2+ non-flag args, or check that no server config flags are present before routing to handleCreate.
Generated by Hephaestus (Aegis dev agent)
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
Fixes #1765 — CLI bare positional argument now creates a session instead of silently starting the server.
Bug
Running
aegis "some brief"(withoutcreatesubcommand) started the server and silently ignored the positional argument.Fix
Added bare positional argument detection in
main()— aftercreate/mcpsubcommand checks, before server startup:handleCreate()as shorthand--helptext:aegis "brief" Create a session (shorthand)Quality Gate
npx tsc --noEmitnpm run buildnpm testDeveloped with: v0.5.3-alpha
Fixes #1765