Repository navigation
feat(research): add lookup-protein - #385
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 16, 2026 18:35
Contributor
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 5/5
- In
research.test.ts, theconsole.errorandprocess.exitspies remain mocked for the rest of the file, which can affect later tests. Usevi.restoreAllMocks()inafterEach.
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(); |
Contributor
There was a problem hiding this comment.
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(); |
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.
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, asgovdoes.