Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__tests__/alexandria-beta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ it('preserves scoped next requests, pagination and discovery receipts', async ()
output,
]);
expect(result.code).toBe(0);
expect(result.stderr).not.toMatch(/Request ID:|Scrape ID:|Credits:/);
expect(requests[0].body.alexandria).toEqual([next]);
const parsed = JSON.parse(readFileSync(output, 'utf8'));
const page = parsed.data.alexandria[0].data;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/alexandria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type AlexandriaOptions = {
output?: string;
json?: boolean;
pretty?: boolean;
showReceipt?: boolean;
};

export function requireAlexandriaKey(apiKey?: string): void {
Expand Down Expand Up @@ -125,7 +126,7 @@ export async function requestAlexandria(
throw new Error('Invalid --request-id.');
requireAlexandriaKey(options.apiKey);
// Print before execution so even an interrupted request can reuse its identity.
console.error(`Request ID: ${requestId}`);
if (options.showReceipt !== false) console.error(`Request ID: ${requestId}`);
let envelope: Record<string, any>;
try {
const app = getClient({ apiKey: options.apiKey, apiUrl: options.apiUrl });
Expand All @@ -147,7 +148,7 @@ export async function requestAlexandria(
envelope = apiFailure(error);
}
const receipt = receiptFor(envelope, 'scrape', requestId);
printReceipt(receipt, false);
if (options.showReceipt !== false) printReceipt(receipt, false);
printRetry(envelope);
return { ...envelope, requestId, receipt };
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export async function handleList(
options: selectors,
},
],
options
{ ...options, showReceipt: false }

@cubic-dev-ai cubic-dev-ai Bot Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: The receipt suppression only covers Find Tools page lookups; root list category lookups still print Request ID because they bypass fetchPage. Apply the same receipt suppression to requestCategories so all catalogue list lookups have receipt-free stderr.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/list.ts, line 333:

<comment>The receipt suppression only covers Find Tools page lookups; root `list` category lookups still print `Request ID` because they bypass `fetchPage`. Apply the same receipt suppression to `requestCategories` so all catalogue `list` lookups have receipt-free stderr.</comment>

<file context>
@@ -330,7 +330,7 @@ export async function handleList(
           },
         ],
-        options
+        { ...options, showReceipt: false }
       );
       receipts.push({
</file context>
Fix with cubic

);
receipts.push({
requestId: envelope.requestId,
Expand Down
Loading