Skip to content

Refactor visualization functions - #11341

Open
undivisible wants to merge 14 commits into
mainfrom
refactor-visualization-functions-12965376793190174944
Open

Refactor visualization functions#11341
undivisible wants to merge 14 commits into
mainfrom
refactor-visualization-functions-12965376793190174944

Conversation

@undivisible

@undivisible undivisible commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Combines generate_topics_visualization into generate_visualization in backend/scripts/rag/current.py as requested.

  • Implements memories: List[Conversation] | None = None support to allow calling either get_data2 or get_data.
  • Fixes edge cases with len(topics) == 0 preventing slicing exceptions.
  • Removes redundant code.
  • Updates entrypoint in __main__ to run generate_visualization([]).

PR created automatically by Jules for task 12965376793190174944 started by @undivisible

Review in cubic


Note

Low Risk
Changes are limited to a RAG script helper and new unit tests; no production API or auth paths.

Overview
Refactors RAG embedding HTML visualization in backend/scripts/rag/current.py by removing generate_topics_visualization and folding its behavior into generate_visualization.

generate_visualization now takes optional memories; when set it uses get_data2, otherwise get_data. Topic query embeddings are only stacked when topics is non-empty, fixing slice errors when topics is []. The function no-ops when there are no embeddings, invalid embedding shape, or fewer than three UMAP samples, and tunes UMAP (init, n_neighbors) for small point counts. The __main__ entrypoint calls generate_visualization([]).

Adds backend/tests/unit/test_rag_visualization.py with isolated module loads and tests for topic vs no-topic paths, empty/insufficient data skips, and the memoriesget_data2 branch.

Reviewed by Cursor Bugbot for commit 2863351. Configure here.

Failure-Class: none

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_12b83a23-e4b0-4a00-ba6a-0de31eb4557e)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be80ac3c0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +121 to +123
if topics:
topic_embeddings = [openai_embeddings.embed_query(topic) for topic in topics]
all_embeddings = cast(Any, np.vstack([all_embeddings] + topic_embeddings))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add regression coverage for empty topic lists

The new if topics path explicitly fixes visualization behavior for topics == [], but this commit adds no test exercising that case. Without a regression test, the zero-length slicing failure this branch addresses can be reintroduced unnoticed; add focused coverage that verifies empty topics preserve all memory points and still generate the visualization.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file

Confidence score: 5/5

  • In backend/scripts/rag/current.py, the if topics fix in generate_visualization appears to address the empty-list slicing edge case, but without a regression test this path could silently break again and reintroduce errors for empty-topic inputs — add a test for generate_visualization([]) that asserts the expected behavior/output.
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="backend/scripts/rag/current.py">

<violation number="1" location="backend/scripts/rag/current.py:121">
P3: The new `if topics` branch fixes the zero-length slicing bug for empty topic lists, but there's no regression test covering this case. Consider adding a test that calls `generate_visualization([])` and asserts it completes without slicing errors and preserves all memory points.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread backend/scripts/rag/current.py
Comment thread backend/scripts/rag/current.py Outdated

topic_embeddings = [openai_embeddings.embed_query(topic) for topic in topics]
all_embeddings = cast(Any, np.vstack([all_embeddings] + topic_embeddings))
if topics:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The new if topics branch fixes the zero-length slicing bug for empty topic lists, but there's no regression test covering this case. Consider adding a test that calls generate_visualization([]) and asserts it completes without slicing errors and preserves all memory points.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/scripts/rag/current.py, line 121:

<comment>The new `if topics` branch fixes the zero-length slicing bug for empty topic lists, but there's no regression test covering this case. Consider adding a test that calls `generate_visualization([])` and asserts it completes without slicing errors and preserves all memory points.</comment>

<file context>
@@ -156,26 +103,34 @@ def get_data2(topics: List[str], retrieved_memories: List[Conversation]) -> dict
 
-    topic_embeddings = [openai_embeddings.embed_query(topic) for topic in topics]
-    all_embeddings = cast(Any, np.vstack([all_embeddings] + topic_embeddings))
+    if topics:
+        topic_embeddings = [openai_embeddings.embed_query(topic) for topic in topics]
+        all_embeddings = cast(Any, np.vstack([all_embeddings] + topic_embeddings))
</file context>

@undivisible undivisible added human Human-authored pull request backend Backend Task (python) workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior AI needs-tests PR introduces logic that should be covered by tests and removed human Human-authored pull request labels Aug 10, 2026

@undivisible undivisible left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The empty-topic entrypoint can load all stored vectors and then run UMAP on empty or too-small data, which can crash on a fresh or sparse store. Please guard empty/insufficient embeddings before UMAP and add a regression test for generate_visualization([]).

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_40bcde46-6ba0-4bf6-a5f4-dba3760518c4)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2443dbeaac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +17 to +19
assert 'all_embeddings.shape[0] < 3' in source
assert 'n_neighbors=min(15, all_embeddings.shape[0] - 1)' in source
assert source.index('all_embeddings.shape[0] < 3') < source.index('umap.UMAP(')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exercise the empty-topic path instead of inspecting source

For topics == [] with at least three embeddings, this test remains green if the fixed slicing is reverted to umap_embeddings[:-len(topics)] (yielding no memory points) or if HTML generation is removed, because it only searches for unrelated empty-data guards and UMAP configuration strings. The newly added AST-only assertions are fresh evidence that the previously reported regression-coverage gap remains; replace them with a test that invokes generate_visualization through mocked data/UMAP seams and verifies that all memory points reach the generated visualization.

AGENTS.md reference: AGENTS.md:L43-L45

Useful? React with 👍 / 👎.

Comment on lines +122 to +124
all_embeddings = cast(Any, np.array(embedding_values))
if all_embeddings.ndim != 2 or all_embeddings.shape[0] < 3:
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate the combined embedding count before returning

When a new account has only one or two stored memory vectors but retrieval supplies enough topics to bring the combined sample count to at least four, this check returns before those topic embeddings are appended, so the Streamlit caller silently gets no visualization. The previous implementation stacked memory and topic embeddings before invoking UMAP and could process that combined set; build the combined matrix first and validate its final sample count instead of rejecting based only on memory count.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8abd52ce5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread commit_again.sh Outdated
@@ -0,0 +1,5 @@
git commit --amend -m "fix: refactor and combine embedding visualization functions

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the commit-amending scratch scripts

When a developer or automation executes this newly tracked root script, it runs git commit --amend against whichever commit is currently checked out; the sibling commit_again_*, fix_*, *_msg.*, and rewrite_commit.py additions are duplicate commit-message scratch artifacts with the same risk and no relationship to the visualization feature. Remove these files so they cannot silently rewrite unrelated work.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for iterating on this. I reviewed the current head and there is one blocking cleanup item before this should merge.

Blocking:

  • rewrite_commit.py should not be committed. It is a repository-root helper that writes directly to .git/COMMIT_EDITMSG at import/runtime, is not part of the RAG visualization implementation, and appears to have been used only to try to rewrite commit metadata. Please remove this file and fix the commit metadata through the normal PR/commit workflow instead. This also aligns with the current Hygiene failure, which is reporting that the fix: commits still do not have a valid Failure-Class: FC-<slug> | new | none declaration in the actual commit history.

Other observations:

  • backend/scripts/rag/current.py is moving in the right direction: consolidating generate_topics_visualization into generate_visualization, allowing memories=None to use get_data, skipping topic embedding/slicing when topics is empty, and bounding UMAP n_neighbors address the sparse/empty visualization path. I did not see an obvious production regression in that code path from static review.
  • backend/tests/unit/test_rag_visualization.py adds coverage for the new pre-UMAP guards, but it is an AST/source-shape test rather than an executable behavior test. That is acceptable as a lightweight guard here, but a future follow-up could make this stronger by stubbing get_data/umap.UMAP and calling generate_visualization([]) directly.

Leaving this as changes requested for the stray root-level commit-rewrite helper and the still-failing Hygiene/failure-class gate.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5a0b6c01-a3de-4cc7-9b1b-13ea418b5020)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fd13081d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +72 to +73
module.generate_visualization([])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Assert that memory points reach the plot

The newly added runtime test is fresh evidence that the previously reported empty-topic coverage gap remains: if the production slicing regresses to umap_embeddings[:-len(topics)], the fitted input still has shape (3, 2) and HTML generation is still called, so both assertions pass even though get_markers receives zero memory points. Assert that its data_points argument contains all three rows, or inspect the rendered trace coordinates.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment on lines +131 to +132
if all_embeddings.shape[0] < 3:
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle three-row UMAP inputs before fitting

When the combined memory/topic matrix has exactly three rows, this check allows it through, but UMAP's default spectral initialization requests n_components + 1 eigenvectors—three eigenvectors from a 3×3 sparse graph—so SciPy raises because k >= N instead of producing the visualization. This affects cases such as two memories plus one topic and the three-memory empty-topic case added in the test; require at least four rows or select an initialization that supports three rows.

Useful? React with 👍 / 👎.

@Git-on-my-level Git-on-my-level removed the needs-tests PR introduces logic that should be covered by tests label Aug 10, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the follow-up. The visualization refactor itself looks reasonable, but there is still one repository-hygiene blocker before this should merge.

Blocking:

  • rewrite_commit.py is still present at the repository root. It executes rewrite() at import/runtime and writes directly to .git/COMMIT_EDITMSG, which is unrelated to the RAG visualization code and should not be committed. Please remove this helper and handle commit metadata through the normal PR/commit workflow.

File-by-file notes:

  • backend/scripts/rag/current.py: consolidating generate_topics_visualization into generate_visualization, making memories optional, skipping topic embeddings when topics is empty, and bounding n_neighbors for small embedding sets all look aligned with the intended refactor. I did not see a production-path regression in this script from static review.
  • backend/tests/unit/test_rag_visualization.py: the new isolated tests exercise both topic-augmented and no-topic visualization paths by stubbing get_data, umap.UMAP, and Plotly, which is useful coverage for the edge cases changed here.
  • rewrite_commit.py: this remains the blocking issue because it is a root-level helper that mutates Git commit-message state and is not part of the backend/RAG visualization implementation.

Leaving this as changes requested for the stray commit-message rewrite helper and the related workflow/hygiene failure. Once that file is removed and the checks are green, this looks like a focused backend refactor.


by AI on behalf of David — leaving this for maintainer review once the workflow/hygiene blocker is fixed.

@undivisible
undivisible force-pushed the refactor-visualization-functions-12965376793190174944 branch from 2fd1308 to 8c45d2d Compare August 10, 2026 21:11
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_1e33d619-0703-489a-b8b2-acd965e90ccf)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c45d2d488

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +119 to +120
if not embedding_values:
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cover the new no-embedding return path

When get_data or get_data2 returns an empty mapping, this new guard is the only thing preventing UMAP from receiving an invalid empty matrix, but both added tests always provide valid vectors. A regression that removes or moves this return would therefore restore the crash while the suite remains green; add a behavioral test with empty data that verifies UMAP and HTML generation are not invoked.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment on lines +113 to +116
if memories is not None:
data = get_data2(topics, memories)
else:
data = get_data(topics)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exercise the retrieved-memories branch

The inspected Streamlit path in backend/scripts/rag/app.py:131 always supplies memories, but both new tests omit that argument and patch only get_data, so this changed get_data2 branch has no behavioral coverage. An inversion or removal of this condition could make the app use generic topic lookup instead of marking the actually retrieved memories while every added test still passes; add a test with non-None memories that verifies get_data2 is selected and its data reaches the plot.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

@undivisible
undivisible force-pushed the refactor-visualization-functions-12965376793190174944 branch from 8c45d2d to cb4e04d Compare August 10, 2026 23:11
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_7f15055e-1c62-48e5-9235-f1b088d3c9be)

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for continuing to tighten this up. The backend visualization refactor itself looks focused, but the current head still has one blocking repository-hygiene/workflow artifact that should not merge.

Blocking:

  • rewrite_commit.py is still committed at the repository root. It imports at top level and calls rewrite() immediately, writing directly to .git/COMMIT_EDITMSG. That is unrelated to the RAG visualization path and should be removed from the PR rather than shipped as source.

File-by-file notes:

  • backend/scripts/rag/current.py: consolidating the old topic-only visualization path into generate_visualization, using get_data() when memories is omitted, skipping topic embeddings/slicing for topics=[], and bounding UMAP n_neighbors all look aligned with the intended sparse/empty visualization behavior.
  • backend/tests/unit/test_rag_visualization.py: the isolated tests now exercise both a topic-augmented small memory set and the topic-free path by stubbing get_data, UMAP, and Plotly, which is useful behavioral coverage for the changed slicing/UMAP boundaries.
  • rewrite_commit.py: this remains the blocker because it is a root-level commit-message rewrite helper with side effects against .git/COMMIT_EDITMSG, not backend visualization code.

Leaving this as changes requested for the stray workflow helper. Once rewrite_commit.py is removed, the remaining backend refactor/test changes look reasonable from this review.


by AI on behalf of David — leaving this for human maintainer review only if there is a workflow/source-hygiene question after the helper is removed.

@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9cbfa426-367d-4ab3-b7b1-9d67ac94f871)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2b50ba012

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +119 to +120
if not embedding_values:
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record skipped visualization as a fallback

When data lookup returns no embeddings—and likewise for the adjacent invalid-shape and insufficient-sample guards—the function returns normally, so the Streamlit caller in backend/scripts/rag/app.py:129-135 continues without a visualization and no operational signal distinguishes degraded generation from a normal request. Emit the shared fallback event on these exits instead of silently dropping the feature.

AGENTS.md reference: AGENTS.md:L91-L91

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Deferred intentionally: this is a local analysis script (backend/scripts/rag/current.py) run manually, not a production request path. The empty/insufficient-sample guards are deliberate no-op exits for the developer running the tool, and record_fallback is a production telemetry contract for provider/mode failovers. Adding it here would emit metrics/log noise with no operational consumer. If visualization generation ever moves behind a served endpoint, the guard should be instrumented there.

umap_instance.fit_transform.return_value = np.array([[0.0, 0.0], [1.0, 1.0], [2.0, 2.0]])
umap_module.UMAP.return_value = umap_instance

module.generate_visualization(['topic'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exercise the below-three-sample return

This test combines two memories with one topic and therefore reaches exactly three rows; every other added test supplies either zero or at least three rows, so none exercises the new all_embeddings.shape[0] < 3 return. Removing or moving that guard would leave the suite green while real UMAP receives an unsupported one- or two-row input, so add a behavioral case asserting that UMAP and HTML generation are not invoked.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

'plotly.subplots': plotly_subplots,
}
):
return load_module_fresh('rag_current_visualization', 'backend/scripts/rag/current.py'), umap_module

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Resolve the module path from the backend test cwd

Because backend/test.sh changes the working directory to backend/ before invoking pytest, this relative path resolves to backend/backend/scripts/rag/current.py. In the documented component runner, every test in this new file therefore fails inside _load_visualization_module with FileNotFoundError before reaching its assertions; resolve the path as scripts/rag/current.py from that working directory or derive an absolute path from __file__.

AGENTS.md reference: backend/AGENTS.md:L223-L223

Useful? React with 👍 / 👎.

@Git-on-my-level Git-on-my-level added positive-signal Good PR — positive signal, not a formal approval and removed workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior labels Aug 11, 2026
@Git-on-my-level
Git-on-my-level dismissed their stale review August 11, 2026 05:03

Resolved on current head: the stray rewrite_commit.py / commit-message helper is no longer in the PR diff.

@Git-on-my-level

Copy link
Copy Markdown
Collaborator

Thanks for cleaning this up — the previous repository-hygiene blocker appears resolved on this head.

Current review notes:

  • backend/scripts/rag/current.py: the refactor now folds the old topic-only visualization path into generate_visualization, keeps the app path working via memories: List[Conversation] | None, uses get_data() for the no-memory entrypoint, avoids topic embedding/slicing when topics=[], and returns before UMAP for empty/non-2D/too-small embedding sets. The n_neighbors cap and init='random' for the 3-point case are appropriate guards for sparse visualization data.
  • backend/tests/unit/test_rag_visualization.py: the new isolated tests cover the topic-augmented path, the no-topic path preserving all memory points, empty-data early return, and the memories/get_data2 branch. I ran the focused test from the repository root with PYTHONPATH=backend; it passed (4 passed). Running the same file from inside backend/ fails because the test passes backend/scripts/rag/current.py to load_module_fresh, which resolves to backend/backend/scripts/rag/current.py from that working directory. That looks like command/working-directory sensitivity rather than a production regression, and the repo-root invocation matches the hermetic checks here.

The earlier rewrite_commit.py / commit-message helper concern is resolved: the current diff only contains backend/scripts/rag/current.py and backend/tests/unit/test_rag_visualization.py. I’m clearing the stale workflow blocker and leaving a positive signal for the focused backend refactor/tests rather than formal approval.


by AI on behalf of David — leaving final merge judgment to the maintainer if they want the backend test to be runnable from additional working directories.

undivisible and others added 8 commits August 12, 2026 23:11
Merges `generate_topics_visualization` into `generate_visualization` to unify the RAG topic embedding visualization. Adds fallback support to `get_data` when memory list is none, resolving issues with empty topic list evaluation in umap slicing. Removes the old `generate_topics_visualization` and updates the run script entry point.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Merges `generate_topics_visualization` into `generate_visualization` to unify the RAG topic embedding visualization. Adds fallback support to `get_data` when memory list is none, resolving issues with empty topic list evaluation in umap slicing. Removes the old `generate_topics_visualization` and updates the run script entry point. Also applies `black` formatting to satisfy CI checks.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Merges `generate_topics_visualization` into `generate_visualization` to unify the RAG topic embedding visualization. Adds fallback support to `get_data` when memory list is none, resolving issues with empty topic list evaluation in umap slicing. Removes the old `generate_topics_visualization` and updates the run script entry point. Also applies `black` formatting to satisfy CI checks.

Failure-Class: none

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Failure-Class: none

Merges `generate_topics_visualization` into `generate_visualization` to unify the RAG topic embedding visualization. Adds fallback support to `get_data` when memory list is none, resolving issues with empty topic list evaluation in umap slicing. Removes the old `generate_topics_visualization` and updates the run script entry point. Also applies `black` formatting to satisfy CI checks.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Exercise empty data and retrieved-memory branches, preserve memory points for empty topics, and use a UMAP initialization that supports three rows. Remove the committed commit-rewrite helper.

Failure-Class: none

Verification: backend/tests/unit/test_rag_visualization.py (4 passed)
@undivisible
undivisible force-pushed the refactor-visualization-functions-12965376793190174944 branch from b2b50ba to 8304cf7 Compare August 12, 2026 15:11
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_84e7bf4a-a23a-4414-a63a-80a165f9891e)

@undivisible
undivisible requested a review from mdmohsin7 as a code owner August 12, 2026 16:52
@mintlify

mintlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Aug 12, 2026, 4:53 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_248ec57f-09e7-42c7-9c14-cc06623a4340)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f265b56b0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/database/_client.py Outdated
Comment on lines +84 to +85
def _build_firestore_client() -> Any:
prepare_google_credentials()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin Firestore to the customer-data service-account project

When SERVICE_ACCOUNT_JSON belongs to the customer-data project but GOOGLE_CLOUD_PROJECT names the GKE compute project—as in the dev listen deployment—prepare_google_credentials() only writes an ADC file and the bare firestore.Client() still resolves the environment project. Reads and writes can therefore target the wrong Firestore database; construct the client with credentials and the project_id from SERVICE_ACCOUNT_JSON instead.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Comment thread backend/config/stt_provider_policy.py Outdated
Comment on lines +134 to +137
# Velma-2 leads on cost. It cannot yet carry 100% of live traffic, so a
# separate Deepgram-first deployment absorbs the remainder; selection is
# per-pod, and a session that fails on Velma is not retried on Deepgram.
STTServingSurface.STREAMING: ('modulate-velma-2', 'dg-nova-3', 'parakeet'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep Deepgram first for live transcription

In every deployment using this default, the change makes Velma-2 the primary live STT provider even though the adjacent comment states it cannot carry all traffic and failed sessions are not retried on Deepgram. The synchronized runtime manifests propagate this ordering to production, so affected live sessions fail instead of reaching the known-capable Deepgram lane; restore dg-nova-3 as the first streaming model.

AGENTS.md reference: backend/AGENTS.md:L162-L162

Useful? React with 👍 / 👎.

Comment thread backend/routers/desktop_realtime.py Outdated
Comment on lines +140 to +142
@router.post("/v2/realtime/session")
async def mint_session(request: MintRequest, uid: str = Depends(get_current_user_uid)) -> JSONResponse:
await run_blocking(db_executor, enforce_chat_quota, uid, "desktop")
if await run_blocking(db_executor, is_trial_paywalled, uid, "desktop"):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Enforce monthly quota before minting realtime tokens

For a basic-tier user whose monthly chat quota is exhausted but whose trial is not expired, this replacement allows /v2/realtime/session to mint a server-funded OpenAI or Gemini token. The same weakened check on /v2/realtime/usage also accepts usage afterward, permitting continued high-cost realtime sessions; retain enforce_chat_quota here rather than checking only the trial paywall.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Comment thread backend/routers/users.py Outdated
Comment on lines +1513 to +1514
@router.post('/v1/users/daily-summary-settings/test', tags=['v1'], response_model=DailySummaryTestResponse)
def test_daily_summary(
request: TestDailySummaryRequest = None,
uid: str = Depends(auth.get_current_user_uid),
x_app_platform: Optional[str] = Header(None, alias='X-App-Platform'),
):
def test_daily_summary(request: TestDailySummaryRequest = None, uid: str = Depends(auth.get_current_user_uid)):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore quota checks on daily-summary generation

For an authenticated free-tier user past the monthly chat allowance, both this test endpoint and /v1/users/daily-summaries/{summary_id}/regenerate now proceed to user-triggered LLM generation because their enforce_chat_quota calls were removed. The test endpoint has no cooldown at all, so it can repeatedly consume platform LLM capacity; restore the gate on both entry points.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Comment thread backend/routers/desktop_chat.py Outdated
Comment on lines 227 to 230
normalized = model.lower()
if normalized in _MODEL_ROUTES:
return normalized in _MANAGED_CHAT_ALIASES
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Route explicit managed lane IDs through the gateway

When /v1/desktop/chat/completions receives the documented model: "omi:auto:chat-agent" (or the structured lane), this predicate now returns false, so the request falls into _request, which rejects the lane ID as an unsupported model with HTTP 400. Keep the explicit managed aliases in this predicate and preserve their selected lane instead of treating them as direct Anthropic model names.

AGENTS.md reference: backend/AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment thread backend/routers/mcp.py Outdated
Comment on lines 545 to 550
conversation_ids = vector_db.query_vectors(query, uid, starts_at=starts_at, ends_at=ends_at, k=limit)
if not conversation_ids:
return []

conversations = conversations_db.get_conversations_by_id(uid, conversation_ids)
redact_conversations_for_list(conversations)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Search transcript chunks in MCP conversation search

When a query phrase appears only in transcript text and not in the conversation's generated summary, this now searches only the summary-vector namespace and returns no result even though transcript-chunk vectors are still indexed. Both MCP transports lost the chunk lookup and match snippets, so exact details such as names, dates, or commitments become undiscoverable; merge transcript-chunk hits with summary hits as before.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Comment thread web/app/src/hooks/useRecording.ts Outdated
Comment on lines +99 to +109
onSegment: (segment: TranscriptSegment) => {
if (!isMountedRef.current) return;
setSegments((prev) => {
// Update existing segment or add new one
const existingIndex = prev.findIndex((s) => s.id === segment.id);
if (existingIndex >= 0) {
const updated = [...prev];
updated[existingIndex] = segment;
return updated;
}
return [...prev, segment];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Bound the live transcript list during long recordings

During a long web recording, every new segment is appended to an unbounded React array and every update linearly scans and copies the entire history. Because the recording UI renders that list, update and render cost grows throughout the session and hour-scale recordings can freeze Chrome; retain only the recent bounded segment window while the server keeps the complete audio.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Comment thread backend/utils/retrieval/rag.py Outdated
Comment on lines +130 to +132
for f in futures:
f.result()
ordered_chunks = [context_data[m.id] for m in memories if m.id in context_data]
context_str = '\n'.join(ordered_chunks).strip()
context_str = '\n'.join(context_data.values()).strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve relevance ordering in assembled RAG context

When multiple memory chunks are built concurrently, workers insert into context_data in completion order, so joining context_data.values() makes prompt ordering depend on executor timing rather than the relevance-sorted memories list. This can move lower-ranked context ahead of the best evidence and make identical retrievals produce different answers; assemble chunks by iterating memories after all futures finish.

AGENTS.md reference: AGENTS.md:L32-L32

Useful? React with 👍 / 👎.

Comment thread backend/utils/stt/pre_recorded.py Outdated
Comment on lines +1192 to +1196
same_prev_speaker = word['speaker'] == segments[-1]['speaker'] if segments else False
seconds_from_prev = word['start'] - segments[-1]['end'] if segments else 0

within_max_duration = (
entry['end'] - segments[-1]['start'] < _MAX_PRE_RECORDED_SEGMENT_DURATION_SECONDS if segments else False
)
if (
segments
and same_prev_speaker
and seconds_from_prev < _MAX_PRE_RECORDED_SEGMENT_DURATION_SECONDS
and within_max_duration
):
segments[-1]['end'] = entry['end']
segments[-1]['text'] += ' ' + entry['text']
else:
segments.append(entry)
# TODO: consider having a max segment size too
if segments and same_prev_speaker and seconds_from_prev < 30:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cap pre-recorded transcript segment duration

When a provider returns a long same-speaker entry—or a continuous series with gaps below 30 seconds—this merger now emits a segment of unbounded duration; a single 75-second provider entry remains one 75-second segment. Restore the 30-second splitting and accumulated-duration check so transcript text and timestamps retain the expected granularity.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Comment on lines +171 to +178
color: isSelected
? Colors.deepPurple.withValues(alpha: 0.3)
: (isSelectionMode && !isEligible)
? Colors.grey.shade800
: const Color(0xFF1F1F25),
borderRadius: BorderRadius.circular(24.0),
border: isSelected
? Border.all(color: Colors.deepPurple, width: 2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace the reintroduced purple selection styling

The selected-conversation state now uses purple for both its fill and border, increasing purple usage on a user-facing mobile surface and violating the locked neutral/white brand invariant. Replace these accents with the established white or neutral selection treatment.

AGENTS.md reference: AGENTS.md:L90-L90

Useful? React with 👍 / 👎.

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_7db9c031-92a5-4453-8466-a68235e111f3)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 365ced7bbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/lib/env/prod_env.dart Outdated
Comment on lines +12 to +13
@EnviedField(varName: 'OPENAI_API_KEY', obfuscate: true)
final String? openAIAPIKey = _ProdEnv.openAIAPIKey;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep server OpenAI credentials out of mobile builds

The production Codemagic workflows write OPENAI_API_KEY into .env, and this new @EnviedField compiles that value into the mobile application so openai.dart can send it directly to OpenAI. Envied obfuscation is reversible, and app/config/client_env_policy.yaml explicitly classifies this key as server-only, so anyone extracting a release binary can recover and abuse the platform credential; route these calls through the authenticated backend instead of exposing the key to ProdEnv.

Useful? React with 👍 / 👎.

Comment on lines +102 to +104
override fun onDestroy() {
// The engine dies with the activity whether or not it is finishing, so these flags
// must clear outside the isFinishing guard — a system-initiated destroy otherwise
// leaves native deferring audio to an engine that is gone (issue #10847).
// configureFlutterEngine re-arms both on the next attach.
OmiBleManager.isFlutterAlive = false
getSharedPreferences("FlutterSharedPreferences", MODE_PRIVATE)
.edit()
.putBoolean("flutter.nativeBleForegroundReady", false)
.apply()
if (isFinishing) {
OmiBleManager.isFlutterAlive = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Clear Flutter liveness on every engine destruction

When Android destroys the activity without isFinishing—for example during a system-initiated recreation—the Flutter engine is still gone, but this leaves OmiBleManager.isFlutterAlive true. OmiBackgroundAudioStreamer.handleCharacteristic then sees that stale flag together with nativeBleForegroundReady and discards frames as though the live Flutter socket still owned them, causing background or batch recording to lose audio until another engine attach resets the state.

Useful? React with 👍 / 👎.

Comment on lines +446 to +448
fun forceReconnect(address: String, requiresBond: Boolean, source: String) {
val addr = address.uppercase()
if (bleManager.isPeripheralConnected(addr)) return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-emit ready for an already-connected BLE service

When Background Mode keeps the foreground service and GATT link alive across a Flutter activity restart, the new Dart transport calls startService, which reaches forceReconnect and returns here because the peripheral is already connected. The fresh transport never receives its only onDeviceReady signal and times out after 60 seconds despite the live link; preserve the prior resync path that adopts the connected GATT and emits ready instead of treating it as a no-op.

Useful? React with 👍 / 👎.

Comment thread app/lib/providers/message_provider.dart Outdated
Comment on lines +352 to +353
setMultiUploadingFileStatus(files.map((e) => e.path).toList(), true);
List<MessageFile>? res;
try {
res = await uploadFilesServer(files, appId: appId);
} catch (e) {
Logger.debug('uploadFiles failed: $e');
res = null;
}
var res = await uploadFilesServer(files, appId: appId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset upload state when the request throws

If uploadFilesServer throws on a network or server failure, execution skips the call that clears setMultiUploadingFileStatus. The picker-level catch only shows an error, while isUploadingFiles remains true and the chat send button stays disabled for the rest of the session; put the status cleanup in a finally block and reconcile the failed selection before propagating or reporting the error.

Useful? React with 👍 / 👎.

Comment thread app/lib/providers/message_provider.dart Outdated
Comment on lines +322 to +325
void clearSelectedFile(int index) {
if (index < 0 || index >= selectedFiles.length) return;
selectedFiles.removeAt(index);
selectedFileTypes.removeAt(index);
if (index < uploadedFiles.length) uploadedFiles.removeAt(index);
uploadedFiles.removeAt(index);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard removal before upload metadata exists

While an attachment upload is still pending, the close button remains enabled and selectedFiles already contains the item, but uploadedFiles is populated only after the request completes. Removing that item therefore calls uploadedFiles.removeAt(index) on an empty or shorter list and throws RangeError; retain the bounds guard so pending or failed attachments can be removed safely.

Useful? React with 👍 / 👎.

Comment on lines +1022 to +1024
finishedSessionId = currentSessionId
finishedClientConversationId = currentClientConversationId
finishedRecordingStartTime = recordingStartTime

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Retain every pending finished recording

When a user invokes Finish and Continue twice before the backend emits the first memory_created, these three singleton fields are overwritten with the second session. The first completion is then rejected against the second conversation ID, leaving its local session uncompleted and eligible for retry/re-upload; keep the prior bounded collection keyed by recording identity so rapid rotations and out-of-order completions reconcile independently.

AGENTS.md reference: AGENTS.md:L122-L122

Useful? React with 👍 / 👎.

Comment on lines +25 to +27
func current() -> AuthSessionAttempt {
AuthSessionAttempt(generation: generation.withLock { $0 })
lock.withLock {
AuthSessionAttempt(generation: generation)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep auth-fence reads independent from commit callbacks

During a background auth commit, the operation holds this lock while writing UserDefaults; the changed .main notification observer synchronously waits for the main thread. If the main thread concurrently builds request headers and calls current() or isCurrent(), it waits on the same lock, producing the frozen sign-in deadlock that the removed regression test exercised; retain a separate nonblocking generation lock for reads or make notification delivery asynchronous.

AGENTS.md reference: AGENTS.md:L122-L122

Useful? React with 👍 / 👎.

Comment on lines 467 to 469
Task { @MainActor in
AnalyticsManager.shared.updateCheckFailed(diagnostics: diagnostics)
self.viewModel?.lastUpdateFailure = diagnostics

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Suppress expected failures from automatic offline checks

When the launch-time or scheduled background Sparkle check runs while the Mac is offline, the removed trigger tracker means this callback now follows the same branch as a failed manual check and stores lastUpdateFailure. Users subsequently opening Update settings see an actionable updater failure for expected offline housekeeping; preserve the automatic-offline classification while continuing to surface failures from user-triggered checks.

AGENTS.md reference: AGENTS.md:L122-L122

Useful? React with 👍 / 👎.

Comment thread backend/routers/desktop_proxy.py Outdated
Comment on lines 392 to 395
_, current, _ = await run_blocking(
critical_executor,
redis_db.check_rate_limit,
uid,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Interpret the Redis limiter tuple as remaining quota

check_rate_limit returns (allowed, remaining, retry_after), but this discards allowed and treats remaining as the current request count. After the user exceeds 1,500 requests Redis returns (False, 0, ...), so the hard-limit comparison remains false and server-funded Gemini calls continue indefinitely; early requests are also incorrectly downgraded because a large remaining balance is mistaken for high usage. Honor allowed and derive usage from _DAILY_HARD_LIMIT - remaining.

AGENTS.md reference: AGENTS.md:L122-L122

Useful? React with 👍 / 👎.

Comment thread app/lib/main.dart Outdated
Comment on lines +233 to +235
await _init();
runApp(const MyApp());
}, (error, stack) => FirebaseCrashlytics.instance.recordError(error, stack, fatal: true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve startup errors before Firebase initializes

If widget binding, routing validation, native setup, or Firebase.initializeApp throws before a Firebase app exists, this zone handler immediately accesses FirebaseCrashlytics.instance, which raises the secondary no-app error and masks the original startup failure. Retain the Firebase.apps.isNotEmpty guard and a debugPrint fallback so pre-Firebase failures remain diagnosable.

Useful? React with 👍 / 👎.

…0174944

Restore the reviewed visualization refactor head (current.py + its test only);
drop the later churn commit that reverted the sparse-data guards and touched
unrelated backend/app/desktop/web files.
Resolve the module path from the test file location so the isolated
visualization tests pass from both the repository root and backend/.
@undivisible
undivisible force-pushed the refactor-visualization-functions-12965376793190174944 branch from 365ced7 to 45d1a06 Compare August 13, 2026 14:29
@cursor

cursor Bot commented Aug 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9ca1b82e-4b31-4a20-ba20-f88ee28bed16)

UMAP cannot fit one or two rows (spectral init requests k>=N eigenvectors);
adds a regression test proving generate_visualization skips both UMAP and
HTML generation for a single-sample input, alongside the existing empty-data
guard coverage.
@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_cd5645a4-eecf-4ed9-88ba-0c2bd0cf40a7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI backend Backend Task (python) positive-signal Good PR — positive signal, not a formal approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants