feat(cli): agent threads in the Alexandria beta - #232
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 3/5
src/index.tscan prompt users to log in even when they provideagent thread <id> --api-key <key>, preventing the supplied key from reaching the handler and blocking API-key-only usage; skip the auth prompt whenoptions.apiKeyis present while retaining the custom-URL check.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/index.ts">
<violation number="1" location="src/index.ts:1721">
P2: When users provide only `agent thread <id> --api-key <key>`, this gate prompts for login before the handler can apply that key. Skip the auth prompt when `options.apiKey` is present, while retaining the custom-URL check.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
| const options = command.optsWithGlobals(); | ||
| // Subcommands are not matched by AUTH_REQUIRED_COMMANDS; gate here. | ||
| const { isCustomApiUrl } = await import('./utils/config'); | ||
| if (!isCustomApiUrl(options.apiUrl)) { |
Contributor
There was a problem hiding this comment.
P2: When users provide only agent thread <id> --api-key <key>, this gate prompts for login before the handler can apply that key. Skip the auth prompt when options.apiKey is present, while retaining the custom-URL check.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/index.ts, line 1721:
<comment>When users provide only `agent thread <id> --api-key <key>`, this gate prompts for login before the handler can apply that key. Skip the auth prompt when `options.apiKey` is present, while retaining the custom-URL check.</comment>
<file context>
@@ -1671,6 +1695,45 @@ function createAgentCommand(): Command {
+ const options = command.optsWithGlobals();
+ // Subcommands are not matched by AUTH_REQUIRED_COMMANDS; gate here.
+ const { isCustomApiUrl } = await import('./utils/config');
+ if (!isCustomApiUrl(options.apiUrl)) {
+ await ensureAuthenticated();
+ }
</file context>
Adds spark-2 agent thread support to the beta CLI, hidden from help like the rest of the Alexandria surface: - agent --thread <id> continues a thread; --mode extract|chat and --effort low|medium|high are forwarded; spark-2 accepted as a model - start and status output carry threadId/threadTurn; chat turns surface message and suggestions - agent thread <id> [--include-data] lists a thread's runs via GET /v2/agent/threads/:id - e2e coverage in alexandria-beta.test.ts, including thread_busy and thread_not_found relays - bump to 1.23.4-alexandria-beta.3 so main publishes under the alexandria tag Co-authored-by: Cursor <cursoragent@cursor.com>
nickscamara
force-pushed
the
alexandria/agent-threads
branch
from
September 16, 2026 10:43
ea77d28 to
78104c6
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
nickscamara
force-pushed
the
alexandria/agent-threads
branch
from
September 16, 2026 10:43
aafe6b4 to
72494ee
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Moves the agent subagent/threads guidance out of the Alexandria skill into beta-skills/firecrawl-agent, and has `setup alexandria` install both beta skills. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Brings the new agent threads API (spark-2,
firecrawlSDK 4.40.0) to the CLI as part of the Alexandria beta. Options are documented in--helplike the rest of the beta surface after #230; thealexandrianpm dist-tag is the gate. Version bumps to1.23.4-alexandria-beta.7so merging publishes under that tag.What's added
firecrawl agent "<prompt>" --thread <threadId>continues an existing thread.--mode extract|chatand--effort low|medium|highare forwarded;spark-2is accepted for--modeland listed as the default.threadId/threadTurn. Status output (--jsonand human-readable) includesthreadId,threadTurn,mode,message, andsuggestionswhen present, so chat turns are readable.firecrawl agent thread <threadId> [--include-data] [--json] [--pretty]lists a thread's runs viaGET /v2/agent/threads/:id.thread_busy409,thread_not_found404) are relayed with the server message and exit 1.beta-skills/firecrawl-agentdocuments usingagentas a web-data subagent and keeping threads for follow-ups;setup alexandriainstalls it alongside the Alexandria skill. The Alexandria skill itself is unchanged.Notes
threadsubcommand shares option names withagent, and commander lets the parent consume known options anywhere in argv, so the subcommand readsoptsWithGlobals(). It also runs the same auth gate thepreActionhook applies toagent(subcommand names are not matched byAUTH_REQUIRED_COMMANDS).Testing
pnpm test: 470 passed (7 new cases inalexandria-beta.test.tscovering continuation, plain-start body shape, malformed--thread, chat status output,thread_busy, thread listing with/without--include-data, andthread_not_found; the help test also asserts the new options and subcommand are documented).pnpm run type-check,pnpm run format:checkclean.