Skip to content

Create assistant#214

Merged
priyanshu6238 merged 11 commits into
mainfrom
create_assistant
Mar 2, 2026
Merged

Create assistant#214
priyanshu6238 merged 11 commits into
mainfrom
create_assistant

Conversation

@priyanshu6238
Copy link
Copy Markdown
Collaborator

@priyanshu6238 priyanshu6238 commented Mar 1, 2026

Summary by CodeRabbit

  • Tests
    • Expanded file-search tests to cover full assistant lifecycle: create (fills name, instructions, selects autocomplete, uploads a sample file), update (searches by shared name, renames, edits instructions, adds files), and delete flows.
    • Introduced a shared assistant name for consistency and updated success/progress assertions to reflect the renamed assistant.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55147b5 and 2b2a541.

📒 Files selected for processing (1)
  • cypress/e2e/filesearch/Filesearch.spec.ts

📝 Walkthrough

Walkthrough

Adds a shared top-level assistantName constant and updates the Filesearch E2E spec to fully fill creation/edit forms (including file uploads and autocomplete), use the shared name for search/selection, update assertions for progress and success messages, and delete the renamed assistant.

Changes

Cohort / File(s) Summary
E2E test updates
cypress/e2e/filesearch/Filesearch.spec.ts
Introduces a top-level assistantName constant. Expands the "should create a new assistant" test to fill name, instructions, autocomplete, upload sample.md, and submit. Updates the "changes the configuration for an assistant" test to search by assistantName, select the item, append " updated" to the name, edit instructions, upload files, click an enabled OK, and assert progress text. Adjusts the "should remove files and delete the assistant" test to search for the updated name, select the item, delete it, and assert the delete success message includes the updated name. Updates related selectors/assertions and messaging accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through tests with tidy paws,
Named an assistant with no pause,
Uploaded files and typed each line,
Renamed, removed — the suite aligned,
A little rabbit cheers, "All green and fine!"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Create assistant' is vague and doesn't specifically describe the actual test changes made to the Cypress test file. Use a more descriptive title that reflects the actual changes, such as 'Update filesearch tests for assistant creation and configuration workflow' or 'Extend assistant creation tests with file upload and instruction editing'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch create_assistant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
cypress/e2e/filesearch/Filesearch.spec.ts (3)

57-65: Tests have implicit ordering dependencies.

This test searches for ${assistantName} updated (line 58) and expects a deletion message containing ${assistantName} updated (line 65), which assumes the "changes the configuration" test ran first and appended " updated" to the name.

Since all three tests are skipped with it.skip, when re-enabled, they will depend on running in sequence. Consider either:

  1. Combining these into a single test to make the dependency explicit
  2. Using before/after hooks for setup/teardown
  3. Making each test independent by creating its own assistant
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cypress/e2e/filesearch/Filesearch.spec.ts` around lines 57 - 65, The failing
test 'should remove files and delete the assistant' has an implicit ordering
dependency on a prior test that renames the assistant to include " updated";
make this test independent by creating its own assistant (or using a before hook
to create one and an after hook to clean it up) and then search/delete that
assistant name within this test; update references to the test's assistantName
variable and the cy.get('input[name=searchInput]').type(...) and the final
assertion to use the locally created assistant name so the test does not rely on
other tests running first.

13-14: Consider linking to an issue for tracking.

The TODO comment explains why tests are skipped, but it would be helpful to reference a GitHub issue number so the fix can be tracked and the tests don't remain skipped indefinitely.

-  //TODO: enable these tests after fixing the file upload issue
+  // TODO(`#XXX`): enable these tests after fixing the file upload issue

Would you like me to open a GitHub issue to track this file upload fix?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cypress/e2e/filesearch/Filesearch.spec.ts` around lines 13 - 14, Update the
TODO in Filesearch.spec.ts that reads "TODO: enable these tests after fixing the
file upload issue" to reference a tracking issue (e.g., append or replace with
"TODO: enable these tests after fixing the file upload issue — tracked in
#<issue-number>" or include the full GitHub issue URL); ensure the comment
contains the issue number/URL so the skipped tests can be tracked and found
later (update the TODO comment string in Filesearch.spec.ts accordingly and use
the same issue ID in any related test metadata or PR description).

19-23: Autocomplete interaction sequence may not work as expected.

The chained .type() calls on the autocomplete element may fail when the test is enabled. After typing 'gpt-3.5-turbo' + '{enter}', the autocomplete dropdown likely closes, so subsequent {downArrow} and {enter} inputs may not target the intended element.

Consider restructuring to explicitly wait for and interact with the dropdown options:

♻️ Suggested approach
-    cy.get('[data-testid=autocomplete-element]')
-      .type('gpt-3.5-turbo' + '{enter}')
-      .type('{downArrow}')
-      .type('{enter}')
-      .wait(500);
+    cy.get('[data-testid=autocomplete-element]')
+      .type('gpt-3.5-turbo');
+    cy.get('[data-testid=autocomplete-element]')
+      .type('{downArrow}')
+      .type('{enter}');
+    cy.wait(500);

Or better yet, explicitly select the dropdown option by its text/value after the dropdown opens.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cypress/e2e/filesearch/Filesearch.spec.ts` around lines 19 - 23, The current
chained cy.get('[data-testid=autocomplete-element]').type('gpt-3.5-turbo' +
'{enter}').type('{downArrow}').type('{enter}') may close the dropdown before the
arrow/enter keystrokes target an option; instead, split the steps: type into the
element, wait or assert that the dropdown/options are visible, then explicitly
select the intended option by locating the option element (e.g., query the
dropdown option by its text/value like "gpt-3.5-turbo" or a role/option
selector) and click it; update the sequence around the
cy.get('[data-testid=autocomplete-element]') call to wait for the options and
then click the specific option rather than chaining keystrokes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cypress/e2e/filesearch/Filesearch.spec.ts`:
- Around line 57-65: The failing test 'should remove files and delete the
assistant' has an implicit ordering dependency on a prior test that renames the
assistant to include " updated"; make this test independent by creating its own
assistant (or using a before hook to create one and an after hook to clean it
up) and then search/delete that assistant name within this test; update
references to the test's assistantName variable and the
cy.get('input[name=searchInput]').type(...) and the final assertion to use the
locally created assistant name so the test does not rely on other tests running
first.
- Around line 13-14: Update the TODO in Filesearch.spec.ts that reads "TODO:
enable these tests after fixing the file upload issue" to reference a tracking
issue (e.g., append or replace with "TODO: enable these tests after fixing the
file upload issue — tracked in #<issue-number>" or include the full GitHub issue
URL); ensure the comment contains the issue number/URL so the skipped tests can
be tracked and found later (update the TODO comment string in Filesearch.spec.ts
accordingly and use the same issue ID in any related test metadata or PR
description).
- Around line 19-23: The current chained
cy.get('[data-testid=autocomplete-element]').type('gpt-3.5-turbo' +
'{enter}').type('{downArrow}').type('{enter}') may close the dropdown before the
arrow/enter keystrokes target an option; instead, split the steps: type into the
element, wait or assert that the dropdown/options are visible, then explicitly
select the intended option by locating the option element (e.g., query the
dropdown option by its text/value like "gpt-3.5-turbo" or a role/option
selector) and click it; update the sequence around the
cy.get('[data-testid=autocomplete-element]') call to wait for the options and
then click the specific option rather than chaining keystrokes.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 972a8da and 4d9faf8.

📒 Files selected for processing (1)
  • cypress/e2e/filesearch/Filesearch.spec.ts

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
cypress/e2e/filesearch/Filesearch.spec.ts (1)

17-21: Replace the fixed sleep with a state-based wait for deterministic test execution.

Line 21 uses cy.wait(500), which can cause flaky tests under variable CI timing. Instead, wait for a specific UI state after the autocomplete selection completes, such as the visibility or enablement of the element that the test interacts with next (line 23's [data-testid="addFiles"] button). For example, use cy.get('[data-testid="addFiles"]').should('be.visible') or .should('not.be.disabled') before clicking it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cypress/e2e/filesearch/Filesearch.spec.ts` around lines 17 - 21, Replace the
fixed cy.wait(500) after interacting with the
'[data-testid=autocomplete-element]' with a state-based assertion that waits for
the next UI element to be ready; specifically, after the .type('{enter}')
sequence, remove cy.wait(500) and instead add an assertion like
cy.get('[data-testid="addFiles"]').should('be.visible') or
.should('not.be.disabled') to ensure the addFiles button is ready before
proceeding (references: the '[data-testid=autocomplete-element]' interaction and
the '[data-testid="addFiles"]' element).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cypress/e2e/filesearch/Filesearch.spec.ts`:
- Around line 33-35: The test currently types into
cy.get('input[name=searchInput]') then calls .first().click() on
cy.get('[data-testid="listItem"]'), which can select the wrong assistant when
results are non-unique or stale; replace the .first().click() usage with
selecting the list item by exact assistant name (matching the assistantName
variable) before clicking—e.g., locate items with data-testid="listItem" and
find/contains the exact assistantName text (or a RegExp anchored to the exact
name) and click that element so update/delete flows target the correct
assistant; apply this change to both occurrences that use .first().click().
- Line 25: The test currently uses a broad selector
cy.get('div').should('contain', 'sample.md') in Filesearch.spec.ts which can
produce false positives; instead scope the assertion to the upload modal/list
container (replace the generic 'div' check) by locating the upload list element
(e.g., the upload modal container or the element with the upload list
data-testid/class) and assert inside that scope that 'sample.md' is present and
visible (use .within or a scoped get/contains on that upload-list container to
ensure the file is asserted only in the upload UI).
- Line 2: The test suite uses a shared, runtime-generated constant assistantName
which makes multiple it blocks depend on the same value and creates order/retry
fragility; change the tests to generate assistant names per test (or create
assistants in beforeEach) instead of using the top-level assistantName
constant—move the generation into each it or into a beforeEach hook, create the
assistant inside the test (or beforeEach) and store it with an alias for later
use so each test is independent; look for the assistantName symbol in
Filesearch.spec.ts and replace its top-level usage with per-test creation and
aliasing.

---

Nitpick comments:
In `@cypress/e2e/filesearch/Filesearch.spec.ts`:
- Around line 17-21: Replace the fixed cy.wait(500) after interacting with the
'[data-testid=autocomplete-element]' with a state-based assertion that waits for
the next UI element to be ready; specifically, after the .type('{enter}')
sequence, remove cy.wait(500) and instead add an assertion like
cy.get('[data-testid="addFiles"]').should('be.visible') or
.should('not.be.disabled') to ensure the addFiles button is ready before
proceeding (references: the '[data-testid=autocomplete-element]' interaction and
the '[data-testid="addFiles"]' element).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a8dd68 and 55147b5.

📒 Files selected for processing (1)
  • cypress/e2e/filesearch/Filesearch.spec.ts

Comment thread cypress/e2e/filesearch/Filesearch.spec.ts
Comment thread cypress/e2e/filesearch/Filesearch.spec.ts Outdated
Comment thread cypress/e2e/filesearch/Filesearch.spec.ts
@priyanshu6238 priyanshu6238 requested a review from mdshamoon March 2, 2026 04:15
Copy link
Copy Markdown
Contributor

@mdshamoon mdshamoon left a comment

Choose a reason for hiding this comment

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

Rest looks good

Comment thread cypress/e2e/filesearch/Filesearch.spec.ts Outdated
@priyanshu6238 priyanshu6238 merged commit f97e82e into main Mar 2, 2026
4 of 6 checks passed
@priyanshu6238 priyanshu6238 deleted the create_assistant branch March 2, 2026 04:41
This was referenced Mar 2, 2026
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.

3 participants