Skip to content

Commit d02576b

Browse files
boristaneclaude
andauthored
fix: catch the CLI up with the current API (#132)
* fix: drop the memory context type from thread ask Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: find services through the node list endpoint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: remove the feed and note command groups Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: port memory commands to the git-backed memory API Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: resolve exact service names before matching substrings The graph only wraps a LIKE value in % when it holds no _ or %, so a query like payments_api was matched as a whole value. Send the pattern explicitly and drop the extra rows the _ wildcard lets through. Short-name resolution now queries exact id, name and alias matches on their own before the substring search, so a page of partial matches can neither hide the exact one nor make a shared name look unique. A full substring page counts as ambiguous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: page past wildcard-only hits when looking up services The _ in a query like payments_api matches any character, so rows such as prod-payments-api-N can fill a whole page and hide the literal match behind them. Each field query now reads pages of 200, ordered by id, until it has `limit` literal matches or runs out (10 pages at most, and a field that hits the cap counts as truncated). The limit applies to literal matches, not raw rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: say when service find shows only part of the matches findServiceNodes now returns whether more services match than it returned, and service find notes it on stderr (unless --quiet), so a capped list no longer looks complete and stdout stays parseable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: report service lookups that stop at the scan cap When the capped scan keeps no literal match, short-name resolution now says the lookup couldn't finish (with the full form and scoped find as next steps) instead of "No service found". service find's JSON output carries `truncated`, so a quiet, machine-read empty result is not mistaken for a complete one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0f133f4 commit d02576b

29 files changed

Lines changed: 470 additions & 651 deletions

‎ERRORS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Hint: polylane workspace use <id>
123123

124124
These are the non-obvious command-level behaviours an agent should know about. Specific error strings are subject to change — use these as categories you can rely on.
125125

126-
### Destructive operations (`auth logout`, `integration disconnect`, `cloud disconnect`, `memory delete`, …)
126+
### Destructive operations (`auth logout`, `integration disconnect`, `cloud disconnect`, …)
127127

128128
- Prompt for confirmation in interactive mode.
129129
- Require `--yes` in non-interactive mode, else exit `2`.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ polylane issue note <issue-id> "rolled back deploy"
130130
polylane service logs <service> --since 1h --grep error
131131
polylane tools run findNodes --params '{"query":"api"}'
132132
polylane thread ask "<prompt>"
133-
polylane memory save "<finding>"
133+
polylane memory list # what the agent has learned (git-backed)
134134
```
135135

136136
## Discovering commands

‎skill/SKILL.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,18 @@ polylane issue note <issue-id> "rolled back deploy ABC"
179179
polylane issue milestone <issue-id> "Mitigated"
180180

181181
# Drill into services
182-
polylane service find "<query>"
182+
polylane service find <part-of-name> # matches id, name or alternate name
183183
polylane service logs <service-id> --since 1h --grep error
184184
polylane service metrics <service-id> --metric <name> --since 1h
185185
polylane service graph <service-id> --direction both --depth 1
186186

187187
# Find the repository, then search it in a local clone
188188
polylane repo find "<query>"
189189

190-
# Save what you learned
191-
polylane memory save "<finding>"
190+
# Read what the agent has learned about this workspace
191+
polylane memory list [--path <dir>]
192+
polylane memory show <path>
193+
polylane memory history
192194
```
193195

194196
### Running agent tools directly
@@ -238,7 +240,7 @@ Attach resources as context by passing their IDs — the CLI infers the resource
238240
polylane workspace list --output json | jq '.items[0].id'
239241

240242
# Chain: find a service → check its logs
241-
SVC=$(polylane service find "payment lambda" --output json --quiet | jq -r '.items[0].id')
243+
SVC=$(polylane service find payments --output json --quiet | jq -r '.items[0].id')
242244
polylane service logs "$SVC" --since 1h --grep error
243245

244246
# Fire-and-forget + later poll

‎src/commands/feed/index.ts‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎src/commands/feed/list.ts‎

Lines changed: 0 additions & 145 deletions
This file was deleted.

‎src/commands/feed/summary.ts‎

Lines changed: 0 additions & 46 deletions
This file was deleted.

‎src/commands/index.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { configCommands } from './config';
44
import { helpCommand } from './help';
55
import { setupCommand } from './setup';
66
import { updateCommand } from './update';
7-
import { feedCommands } from './feed';
87
import { issueCommands } from './issue';
98
import { serviceCommands } from './service';
109
import { repoCommands } from './repo';
@@ -16,7 +15,6 @@ import { workspaceCommands } from './workspace';
1615
import { subscriptionCommands } from './subscription';
1716
import { apiCommands } from './api';
1817
import { telemetryCommands } from './telemetry';
19-
import { noteCommands } from './note';
2018
import { autofixCommands } from './autofix';
2119
import { artifactCommands } from './artifact';
2220
import { toolsCommands } from './tools';
@@ -28,7 +26,6 @@ export function registerAllCommands(): void {
2826
registered = true;
2927

3028
const all = [
31-
...feedCommands,
3229
...issueCommands,
3330
...serviceCommands,
3431
...repoCommands,
@@ -38,7 +35,6 @@ export function registerAllCommands(): void {
3835
...cloudCommands,
3936
...workspaceCommands,
4037
...subscriptionCommands,
41-
...noteCommands,
4238
...autofixCommands,
4339
...artifactCommands,
4440
...toolsCommands,

‎src/commands/memory/delete.ts‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎src/commands/memory/find.ts‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎src/commands/memory/history.ts‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { Command } from '../../command';
2+
import type { Config } from '../../config/schema';
3+
import { PolylaneAPI } from '../../generated/client';
4+
import { formatList } from '../../output/formatter';
5+
import { requireWorkspace, getArgNumber } from '../helpers';
6+
7+
export const memoryHistoryCommand: Command = {
8+
name: 'memory history',
9+
description: 'List recent commits to the workspace memory repository',
10+
operationId: 'memories.commits',
11+
options: [{ flag: '--limit <n>', description: 'Max commits (default 20)', type: 'number' }],
12+
async execute(config: Config, _flags, args: Record<string, unknown>): Promise<void> {
13+
const workspaceId = await requireWorkspace(config);
14+
const limit = getArgNumber(args, 'limit') ?? 20;
15+
16+
const api = new PolylaneAPI(config);
17+
const result = await api.memoriesCommits(workspaceId, { limit });
18+
19+
const items = result.items.map((c) => ({
20+
hash: c.hash,
21+
subject: c.subject,
22+
author: c.authorName,
23+
committed: new Date(c.committedAt * 1000).toISOString(),
24+
}));
25+
26+
formatList(
27+
config,
28+
{ items, count: items.length },
29+
{
30+
headers: ['Commit', 'Subject', 'Author', 'Committed'],
31+
rows: (item) => [item.hash.slice(0, 7), item.subject, item.author, item.committed],
32+
}
33+
);
34+
},
35+
};

0 commit comments

Comments
 (0)