Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update docs script#1090

Closed
SamKomesarook wants to merge 6 commits intomainfrom
update-docs-script
Closed

Update docs script#1090
SamKomesarook wants to merge 6 commits intomainfrom
update-docs-script

Conversation

@SamKomesarook
Copy link
Collaborator

@SamKomesarook SamKomesarook commented Dec 14, 2025

Note

Adds CI + script to auto-generate docs PRs via LLM and updates trace view to support initial span selection and optional routing disable (for embeds).

  • CI/Docs Automation
    • Add GitHub Actions workflow /.github/workflows/llm-docs-pr.yml to diff main, generate docs patches via LLM, and open a PR to the docs repo.
  • Script
    • Introduce scripts/generate_docs.py to construct prompts from app diffs, pull limited docs context, call OpenAI, validate/sanitize output, and apply the suggested patch.
  • Frontend
    • Update frontend/components/shared/traces/trace-view.tsx:
      • Add props initialSpanId and disableRouting.
      • Preserve selection across search param changes and avoid URL updates when routing is disabled.
      • Initialize selection from initialSpanId and guard re-initialization with useRef.

Written by Cursor Bugbot for commit 505970f. This will update automatically on new commits. Configure here.


Important

Automates docs updates via GitHub Action and LLM, updates TraceView for initial span selection, and adds a trace embedding blog post.

  • CI/Automation:
    • Add workflow llm-docs-pr.yml to automate docs PRs by generating patches and opening PRs to the docs repo.
  • Docs Tooling:
    • Introduce generate_docs.py to create LLM prompts from app diffs, call OpenAI, and apply patches with safeguards.
  • Frontend:
    • Update trace-view.tsx to add initialSpanId and disableRouting props, preserving initial span selection without routing.
  • Content:
    • Add blog post 2025-12-09-span-embed-demo.mdx demonstrating <Trace> embed usage with id, optional spanId, and host.

This description was created by Ellipsis for 505970f. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to f701287 in 2 minutes and 8 seconds. Click for details.
  • Reviewed 434 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/llm-docs-pr.yml:27
  • Draft comment:
    Good use of 'set -euo pipefail' to ensure script robustness.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. .github/workflows/llm-docs-pr.yml:50
  • Draft comment:
    Ensure that the DOCS_PAT secret is correctly configured to allow PR creation in the docs repo.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to ensure that a configuration is correct, which violates the rule against asking the author to ensure things are correct or tested. It doesn't provide a specific suggestion or point out a specific issue with the code.
3. frontend/assets/blog/2025-12-09-span-embed-demo.mdx:16
  • Draft comment:
    Reminder: update the 'host' field from localhost to your production domain before deployment.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative and does not provide a specific code suggestion or request for clarification. It simply reminds the author to update a field, which is not within the guidelines for useful comments.
4. frontend/components/shared/traces/trace-view.tsx:43
  • Draft comment:
    The addition of 'initialSpanId' and 'disableRouting' props improves embed handling. Ensure state updates (like selection) remain idempotent.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. frontend/components/shared/traces/trace-view.tsx:147
  • Draft comment:
    The useEffect logic correctly avoids resetting selection when routing is disabled; the hasInitializedSelection ref is a neat solution.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, as it praises the use of useEffect logic and the hasInitializedSelection ref without providing any actionable feedback or suggestions for improvement. It does not align with the rules for useful comments.
6. scripts/generate_docs.py:155
  • Draft comment:
    The use of openai.OpenAI(api_key=...) is non-standard. Consider setting openai.api_key directly and calling openai.ChatCompletion.create.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment appears to be factually incorrect. The code uses openai.OpenAI(api_key=...) which is the current, standard way to use the OpenAI Python SDK (v1.0+). The suggested approach of setting openai.api_key directly and calling openai.ChatCompletion.create is the OLD API style from v0.x that has been deprecated. The comment is giving outdated advice that would actually make the code worse. This is a clear case where the comment should be deleted because it's incorrect. Could there be a scenario where the project is intentionally using an older version of the OpenAI SDK? Maybe the comment is correct for their specific environment? Even if they were using an older SDK version, the current code would fail at import/runtime, which would be caught by the build or testing. The rules explicitly state not to comment on things that would be obviously caught by the build. More importantly, the comment claims the current approach is "non-standard" when it's actually the modern standard, making the comment objectively incorrect. This comment should be deleted. It incorrectly claims the modern OpenAI SDK usage is "non-standard" and suggests using the deprecated v0.x API instead. The advice is factually wrong and would make the code worse.

Workflow ID: wflow_j8lirIpZSlLdzBj2

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 42c7637 in 56 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. scripts/generate_docs.py:149
  • Draft comment:
    The addition of checking for '/../' in the file path improves security by preventing directory traversal. For even more robust safety, consider normalizing paths (e.g., using pathlib.resolve) to fully validate that paths remain within the expected directory.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_27ioGeH21nj0FuBa

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed ba01752 in 1 minute and 15 seconds. Click for details.
  • Reviewed 36 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/llm-docs-pr.yml:16
  • Draft comment:
    Good use of a repository variable for DOCS_REPO instead of a hardcoded string. Ensure that this variable is correctly defined in your repository settings.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to ensure that a variable is correctly defined, which falls under the rule of not asking the author to ensure or verify things. It doesn't provide a specific suggestion or point out a specific issue in the code.
2. .github/workflows/llm-docs-pr.yml:24
  • Draft comment:
    Nice addition of a guard step to ensure DOCS_REPO is configured. Consider referencing documentation to clarify the expected format for this variable.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment suggests referencing documentation, which is a purely informative suggestion. It doesn't provide a specific code suggestion or point out a potential issue with the code. Therefore, it violates the rule against making purely informative comments.
3. .github/workflows/llm-docs-pr.yml:75
  • Draft comment:
    Removing the upper bound on the openai dependency (>=1.55 instead of >=1.55,<2) may allow breaking changes from future major releases. Consider pinning an upper version bound if compatibility is a concern.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_rIjYxwEBeO5k6yx7

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 46dbdb4 in 41 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. scripts/generate_docs.py:149
  • Draft comment:
    The added check for paths ending with '/..' improves safety, but relying solely on string matching can be brittle. Consider using path normalization (e.g., pathlib.Path.resolve or os.path.normpath) to robustly detect any traversal attempts.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_QerMmCKfgH9GFPGZ

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 505970f in 27 seconds. Click for details.
  • Reviewed 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/assets/blog/2025-12-09-span-embed-demo.mdx:1
  • Draft comment:
    Removed blog post file. Confirm that its removal is intentional and that any references or links pointing to this demo have been updated.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_SDyk6bUVyvYP0IOG

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

setTrace(trace);

const spanId = searchParams.get("spanId");
const spanId = initialSpanId || searchParams.get("spanId");
Copy link

Choose a reason for hiding this comment

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

Bug: initialSpanId overrides user selections when routing is enabled

When initialSpanId is provided but disableRouting is false (the default), user span selections get immediately overridden. The guard on line 149 only triggers when disableRouting is true, but the span selection logic on line 157 always prioritizes initialSpanId over searchParams. When a user clicks a span, the URL updates, triggering the useEffect, which then resets the selection back to initialSpanId because of the || precedence.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant