Skip to content

feat(research): add lookup-protein - #385

Merged
KrisOei merged 2 commits into
mainfrom
feat/research-lookup-protein
Nov 16, 2026
Merged

KrisOei merged 2 commits into
mainfrom
feat/research-lookup-protein

Conversation

@PhantomInTheWire

@PhantomInTheWire PhantomInTheWire commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Adds firecrawl research lookup-protein <protein> [--organism <organism>], which prints one protein's curated UniProt subcellular location, GO cellular-component terms and function, with an evidence label and paper IDs on each statement. Research commands with an API key now print the API's error message, as gov does.

$ firecrawl research lookup-protein RPUSD3
# RPUSD3 (Q6P087, RUSD3_HUMAN), Homo sapiens
Mitochondrial mRNA pseudouridine synthase RPUSD3. Matched by gene symbol.

Subcellular location
- Mitochondrion matrix. Experimental [pmid:27974379]
GO cellular component (experimental)
- mitochondrial matrix (GO:0005759), IDA, FlyBase [pmid:27974379]
Function
- Catalyzes uridine to pseudouridine isomerization (...). Experimental [pmid:27667664, pmid:27974379]
Open a cited paper with `firecrawl research inspect-paper <paperId>` or `firecrawl research read-paper <paperId> --question <question>`.
Source: https://www.uniprot.org/uniprotkb/Q6P087/entry. Protein data from UniProtKB/Swiss-Prot release 2026_04. Copyright UniProt Consortium, https://www.uniprot.org. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/. No warranty, see https://www.uniprot.org/help/license. Selected fields, reformatted.

$ firecrawl research lookup-protein RPUSD3 --organism Martian
Error: unknown organism 'Martian': pass an NCBI taxon ID such as 9606, a scientific name such as Homo sapiens, or a UniProt common name such as Human

firecrawl research lookup-protein <protein> [--organism <organism>] calls
GET /v2/search/research/proteins and prints a protein's curated UniProt
subcellular location, GO cellular-component terms and function, each
statement with its evidence label and cited paper IDs. An ambiguous name
lists candidates, and a miss says what to pass instead.

Research commands now print the API's error message on the keyed path, as
gov does, so a refused organism names what to pass.
…yed GET error relay

lookup-protein prints the API's notice under a found entry and under the
candidate list, so the copyright credit, license, no-warranty link and
reformatting note reach the reader. The skill entry leaves this change
because the catalog syncs on every merge, before a release ships the
command. gov and research use one keyedGet helper to relay API errors.
@KrisOei
KrisOei marked this pull request as ready for review November 16, 2026 18:35

@KrisOei KrisOei left a comment

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.

lgtm

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

1 issue found across 7 files

Confidence score: 5/5

  • In research.test.ts, the console.error and process.exit spies remain mocked for the rest of the file, which can affect later tests. Use vi.restoreAllMocks() in afterEach.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/__tests__/commands/research.test.ts">

<violation number="1" location="src/__tests__/commands/research.test.ts:223">
P3: `vi.clearAllMocks()` does not restore the `console.error` and `process.exit` spies these tests install, so they stay mocked for the rest of the file. Use `vi.restoreAllMocks()` in this afterEach, as the other test files do.</violation>
</file>

Shadow auto-approve: would auto-approve with 1 open P3 issue. Adds a new research lookup-protein subcommand printing curated UniProt location/function/GO terms with citations, plus shared keyed GET error handling for research/gov, with tests and docs. Bounded additive CLI feature; no existing behavior or configuration changes.

View guided diff | Turn on auto-fix | Re-trigger cubic


afterEach(() => {
teardownTest();
vi.clearAllMocks();

@cubic-dev-ai cubic-dev-ai Bot Nov 16, 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.

P3: vi.clearAllMocks() does not restore the console.error and process.exit spies these tests install, so they stay mocked for the rest of the file. Use vi.restoreAllMocks() in this afterEach, as the other test files do.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/__tests__/commands/research.test.ts, line 223:

<comment>`vi.clearAllMocks()` does not restore the `console.error` and `process.exit` spies these tests install, so they stay mocked for the rest of the file. Use `vi.restoreAllMocks()` in this afterEach, as the other test files do.</comment>

<file context>
@@ -116,3 +119,288 @@ describe('handleSearchPapersCommand', () => {
+
+  afterEach(() => {
+    teardownTest();
+    vi.clearAllMocks();
+    vi.unstubAllEnvs();
+    vi.unstubAllGlobals();
</file context>
Suggested change
vi.clearAllMocks();
vi.restoreAllMocks();
Fix with cubic

@KrisOei
KrisOei merged commit 0eee409 into main Nov 16, 2026
8 checks passed
@KrisOei
KrisOei deleted the feat/research-lookup-protein branch November 16, 2026 18:38
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.

2 participants