From d600ea8c411d5f9962a64ea52bba6ec21ac661be Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 29 Mar 2026 08:01:37 +0300 Subject: feat: implicit add for na/no-agent scope prefix Amp-Thread-ID: https://ampcode.com/threads/T-019d37f6-6549-7119-979a-88bc1225c594 Co-authored-by: Amp --- internal/askcli/dispatch.go | 5 +++++ internal/askcli/dispatch_test.go | 8 +++++++- internal/version.go | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/askcli/dispatch.go b/internal/askcli/dispatch.go index 974ceea..eab793b 100644 --- a/internal/askcli/dispatch.go +++ b/internal/askcli/dispatch.go @@ -53,6 +53,11 @@ func (d *Dispatcher) Dispatch(ctx context.Context, args []string, stdin io.Reade } subcommand := args[0] entry, ok := commandRegistry.get(subcommand) + if !ok && scope != taskScopeAgent { + args = append([]string{"add"}, args...) + subcommand = "add" + entry, ok = commandRegistry.get(subcommand) + } if !ok { return d.unknownCommand(stderr, subcommand) } diff --git a/internal/askcli/dispatch_test.go b/internal/askcli/dispatch_test.go index cc5854d..ebd7273 100644 --- a/internal/askcli/dispatch_test.go +++ b/internal/askcli/dispatch_test.go @@ -223,6 +223,11 @@ func TestDispatcher_NoAgentPrefix_StripsScopePrefix(t *testing.T) { args: []string{"no-agent", "add", "new task description"}, wantCalls: [][]string{{"add", "rc.verbose=nothing", "rc.verbose=new-uuid", "new task description"}}, }, + { + name: "na implicit add", + args: []string{"na", "description", "here"}, + wantCalls: [][]string{{"add", "rc.verbose=nothing", "rc.verbose=new-uuid", "description here"}}, + }, } for _, tc := range tests { @@ -235,7 +240,8 @@ func TestDispatcher_NoAgentPrefix_StripsScopePrefix(t *testing.T) { _, _ = io.WriteString(stdout, taskJSONFor("test-uuid")) case "uuid:test-uuid export": _, _ = io.WriteString(stdout, taskJSONFor("test-uuid")) - case "add rc.verbose=nothing rc.verbose=new-uuid new task description": + case "add rc.verbose=nothing rc.verbose=new-uuid new task description", + "add rc.verbose=nothing rc.verbose=new-uuid description here": _, _ = io.WriteString(stdout, "Created task task-uuid-abc.\n") default: t.Fatalf("unexpected runner args: %v", args) diff --git a/internal/version.go b/internal/version.go index 49202d9..2366e29 100644 --- a/internal/version.go +++ b/internal/version.go @@ -1,4 +1,4 @@ // Package internal provides the Hexai semantic version identifier used by CLI and LSP binaries. package internal -const Version = "0.27.3" +const Version = "0.28.0" -- cgit v1.2.3