Skip to content

fix: bare positional arg creates session instead of starting server (#1765)#1783

Merged
OneStepAt4time merged 2 commits intodevelopfrom
fix/1765-positional-arg
Apr 14, 2026
Merged

fix: bare positional arg creates session instead of starting server (#1765)#1783
OneStepAt4time merged 2 commits intodevelopfrom
fix/1765-positional-arg

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Summary

Fixes #1765 — CLI bare positional argument now creates a session instead of silently starting the server.

Bug

Running aegis "some brief" (without create subcommand) started the server and silently ignored the positional argument.

Fix

Added bare positional argument detection in main() — after create/mcp subcommand checks, before server startup:

  • Detects non-flag, non-subcommand positional arg
  • Routes to handleCreate() as shorthand
  • Updated --help text: aegis "brief" Create a session (shorthand)

Quality Gate

  • npx tsc --noEmit
  • npm run build
  • npm test

Developed with: v0.5.3-alpha

Fixes #1765

Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ REQUEST_CHANGES

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.

Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved after fix — narrow guard (args.length === 1 && !args[0].startsWith('-')) only triggers for true shorthand, won't interfere with server startup.

@OneStepAt4time OneStepAt4time merged commit cc918c3 into develop Apr 14, 2026
10 checks passed
@OneStepAt4time OneStepAt4time deleted the fix/1765-positional-arg branch April 14, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant