Skip to content

Respect cloud sync consent across session changes - #227

Open
Desperado wants to merge 1 commit into
mainfrom
fix/qua-2429-cloudsync-isolation
Open

Desperado wants to merge 1 commit into
mainfrom
fix/qua-2429-cloudsync-isolation

Conversation

@Desperado

Copy link
Copy Markdown
Contributor

Turning off cloud sync clears the active tracker immediately. Turning it back on starts a new session at the current history and token offsets. Messages entered while sync was disabled stay local, including when the user switches projects before enabling sync again.

A read error at the first-time consent prompt leaves the preference unset so the user can answer later. Pressing Enter still selects the displayed default.

Tests exercise the HTTP requests across opt-out and re-enable, scoped history across projects, and an interrupted prompt. Ran go test ./... and go vet ./....

@qualitymaxapp

qualitymaxapp Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

QualityMax Review

Verdict: COMMENT · Confidence: evidence-backed scan

Re-review: Open the QualityMax check and select Re-review after it completes.

Files eligible: 3 · Files reviewed: 3 · Files with findings: 0 · Findings: 0 · Inline cards: 0

Priority findings

priority location finding
— — No blocking findings

Review gates

gate status
AI diff review completed · eligible 3, reviewed 3 · MODEL-ONLY findings are advisory · batches reviewed 1 of 1 · LLM · served gemini-3.1-flash-lite
SAST completed · eligible 3, reviewed 3 · hybrid · served qwen3.7-plus
Overall review evidence clean
Inline evidence not needed

Important files

file risk note next step
— — No findings —

Change diagram — Flow

flowchart TD
    Input[User Command: /set or /settings] --> Reconcile[reconcileCloudSession]
    Reconcile --> CheckConfig{Config.CloudSync == false?}
    CheckConfig -- Yes --> Stop[stopCloudSession]
    CheckConfig -- No --> Start[startCloudSession]
    Stop --> Done[Session Inactive]
    Start --> Active[Session Active]
Loading

Review lifecycle

Use the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 0 prior card(s) are stale/resolved on this head. @qmax Q&A is tracked separately.

Proof legend: GROUNDED deterministic scanner evidence · MODEL-ONLY advisory model judgment · MODEL-REVIEWED patch model judgment, not reproduction.

QualityMax project results are available in the configured project.

Receipt · commit 431b9c0a41dc36f92c856196c9b4cc85509ea436 · run 2026-11-26T23:44:51+00:00 · model served qwen3.7-plus, gemini-3.1-flash-lite · model requested qwen3.7-plus, gemini-3.1-flash-lite · model review recorded — 1459 model output tokens · model source repository ai_review_preferences.preferred_model · re-review 2 · proof counts {}

@qualitymaxapp qualitymaxapp 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.

QualityMax Review — canonical overview updated; no inline findings were created for this review.

@qualitymaxapp

qualitymaxapp Bot commented Nov 26, 2026

Copy link
Copy Markdown

QualityMax Code Health

Grade A · 100/100 · PASS — 0 finding(s) in 3 file(s).

No code-health findings.

Full report · Commit 431b9c0

@qualitymaxapp

qualitymaxapp Bot commented Nov 26, 2026

Copy link
Copy Markdown

⚠️ QualityMax Pipeline

Gate Result
🔍 AI diff review ✅ Clean · gemini-3.1-flash-lite · completed · 3 eligible / 3 reviewed · gemini-3.1-flash-lite
🔍 SAST completed · 3 eligible / 3 reviewed · qwen3.7-plus
🔍 Canonical PR review delivery completed · 0 eligible / 0 reviewed · exact-head review #6081619243 and overview #7205797886 confirmed
🔍 Repository runtime evidence completed · 0 eligible / 0 reviewed · runtime execution passed for the assessed revision
🔍 Runtime evidence policy completed · 0 eligible / 0 reviewed · admissible runtime evidence satisfies this advisory runtime-only policy
🧪 Repo Tests ✅ 1591/1591 passed (go)
🤖 AI Tests ❌ blocked before sandbox execution (sandbox_concurrency_limit; go_test)

Powered by QualityMax — AI-Powered Test Automation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The regression test calls Stop() directly and leaves REPL consent wiring untested; same-run Run coverage is needed to verify that abandoned sessions neither complete nor upload and new sessions upload only post-opt-in messages.

1 open issue
What changed in this PR

This PR makes cloud session tracking respect consent changes in the terminal REPL, keeping messages entered while sync is disabled out of later uploads.

Changes:

  • Clear the active tracker on opt-out and establish fresh history and token boundaries on re-enable.
  • Leave the consent preference unset when the first-time prompt encounters a read error.
  • Add regression tests for interrupted consent and history isolation across opt-out and project changes.
File Description
internal/​session/​cloud_session.go Handle consent read errors and reset tracking without uploading on opt-out.
internal/​session/​cloud_session_test.go Test interrupted prompts and post-opt-in upload boundaries.
internal/​repl/​repl.go Reconcile cloud tracking after command and settings changes.

Review effort: Balanced

Comment thread internal/repl/repl.go
reconcileCloudSession := func() {
cfg := ag.AppConfig
if cfg != nil && cfg.CloudSync != nil && !*cfg.CloudSync {
stopCloudSession()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants