Skip to content

fix: restore chat artifacts and reliable iOS photo loading - #418

Merged
sparkleMing merged 4 commits into
mainfrom
codex/chat-media-reliability
Sep 1, 2026
Merged

sparkleMing merged 4 commits into
mainfrom
codex/chat-media-reliability

Conversation

@whbzju

@whbzju whbzju commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Give chat artifacts a stable UI identity and merge later revisions instead of appending duplicate cards.
  • Seed active-turn artifact collection from persisted history and recover only the newest artifact revision for each turn.
  • Add a bounded, cancellable, shared thumbnail loader with an LRU cache, timeout handling, and retry UI for the image picker.
  • Pause background photo suggestions while the picker is open so both flows do not compete for PhotoKit work.
  • Use PhotoKit opportunistic delivery on Apple platforms so photo_manager receives the final non-degraded thumbnail instead of leaving fast-format requests unresolved.

Why

SuperAgent conversations could show repeated timeline cards after artifact replay/recovery, and recent turns could appear stale. On iOS, rapid scrolling in the album picker could leave many thumbnail cells blank; an initial fast-format mitigation also exposed a PhotoKit/plugin incompatibility that left the whole grid loading.

No linked issue; reproduced on a physical iPhone from user reports.

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Localization
  • Refactor
  • Tests

Risk areas

  • Database schema or migration
  • Local file storage, backup, or restore
  • App lock, security, or privacy boundary
  • Agent orchestration, skills, or background tasks
  • LLM provider configuration or authentication
  • iOS platform behavior
  • Android platform behavior
  • User-facing strings / localization
  • None of the above

Screenshots or recordings

No visual redesign. The change addresses duplicate artifact cards and blank/loading thumbnail cells. A signed Release-global build was installed on an iPhone 16 Pro Max for user verification.

Test plan

  • Added/updated unit tests for artifact identity/revision merging, persisted turn recovery, thumbnail concurrency, cancellation, caching, and the Apple delivery mode.
  • Added/updated widget tests for thumbnail loading, automatic/manual retry, recycled-cell cancellation, and chat artifact coalescing.
  • Exact focused test files:
    • test/data/model/chat_artifact_test.dart
    • test/data/services/chat_session_storage_test.dart
    • test/data/services/photo_thumbnail_service_test.dart
    • test/ui/chat/widgets/agent_chat_dialog_test.dart
    • test/ui/core/widgets/reliable_asset_picker_test.dart
  • Focused suite: 59 tests passed.
  • flutter test run: 914 passed, 5 skipped, 3 unrelated pre-existing failures:
    • Two stale FilledButton("Save") finders in test/ui/settings/location_context_settings_page_test.dart.
    • One stale active-download finder in test/ui/settings/widgets/early_update_settings_card_test.dart.
  • flutter analyze run: 157 pre-existing info-level lints; no errors or warnings in changed files. Targeted analysis of the picker/service files reports no issues.
  • Manual iOS check: Release-global 1.0.36 (120) built with Xcode and installed via devicectl without uninstalling; final user behavior verification is pending.
  • Manual Android check: not run because the reported picker regression and delivery-mode fix are iOS-specific; shared logic is covered by unit/widget tests.
  • Not run: no additional integration test because the artifact persistence path is covered by storage/service/widget regression tests and the PhotoKit behavior requires a physical iOS device.

Contributor checklist

  • I read CONTRIBUTING.md.
  • I kept this PR focused on the two reliability failures reported in the same chat/media flow.
  • I did not edit generated *.g.dart files manually.
  • I did not add telemetry, hidden network calls, secrets, or signing keys.
  • I updated the implementation notes; no localization update is needed because no user-facing strings changed.

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

PR AI Review / PR AI 语义预检

中文

  • 风险等级:高风险
  • 需要人工审核:是
  • 黄金链路影响:可能
  • 置信度:high
  • Workflow run:33358028454

AI 语义预检未得到可解析结果,需要 maintainer 人工审核。

影响范围

  • unknown

黄金链路

  • none
  • 说明:Claude Code Action 未产出结构化 JSON,AI 语义预检结果不可用。

风险项

  • high AI review 结果不可用。证据:Claude Code Action structured_output was empty or invalid.。
    建议:检查 Claude Action 日志和模型网关配置后重新运行 workflow。

测试缺口

  • 未发现新的测试缺口。

English

  • Risk level: HIGH
  • Human review required: YES
  • Golden path impact: POSSIBLE
  • Confidence: high
  • Workflow run: 33358028454

AI semantic review did not return a parseable result; maintainer review is required.

Affected Areas

  • unknown

Golden Path

  • none
  • Rationale: Claude Code Action did not produce structured JSON, so the AI review result is unavailable.

Findings

  • high AI review result unavailable. Evidence: Claude Code Action structured_output was empty or invalid..
    Recommendation: Check Claude Action logs and model gateway configuration, then rerun the workflow.

Test Gaps

  • No new test gap was reported.

AI review is advisory. Maintainers should verify the result before merging.

@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review labels Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

PR Preflight Summary / PR 预检汇总

中文

  • 统一结论:低风险:两个预检均已完成,质量预检通过,可走普通手动合并流程。
  • Policy preflight:低风险。未命中打回或高风险规则。
  • Flutter quality:通过。Analyzer 和 test baseline 均未发现新增问题。
  • PR head:ba31a74ff7da4eca1df7750d67e34230a0110f21
  • Policy run:33358028471
  • Flutter run:33358030004

English

  • Combined result: Low risk: both preflights completed and quality passed; use the normal manual merge flow.
  • Policy preflight: LOW RISK. No blocking or high-risk policy signal was found.
  • Flutter quality: PASS. Analyzer and test baselines found no newly introduced issue.
  • PR head: ba31a74ff7da4eca1df7750d67e34230a0110f21
  • Policy run: 33358028471
  • Flutter run: 33358030004
PR Policy Preflight / PR 规则预检

PR Policy Preflight / PR 规则预检

中文

  • 判定:低风险
  • 变更文件数:14
  • 变更行数:1502
  • Diff 是否截断:false

未发现确定性规则问题。

English

  • Decision: LOW RISK
  • Changed files: 14
  • Changed lines: 1502
  • Diff truncated: false

No deterministic policy findings.

PR Flutter Quality / Flutter 质量预检

PR Flutter Quality / Flutter 质量预检

中文

  • 总体:通过
  • Analyzer baseline:通过
  • Test baseline:通过

English

  • Overall: PASS
  • Analyzer baseline: PASS
  • Test baseline: PASS

Flutter Analyzer Baseline

  • Base issues: 161
  • PR issues: 161
  • New issues: 0

No new analyzer issues introduced by this PR.

Flutter Test Baseline

  • Base failures: 0
  • PR failures: 0
  • New failures: 0

No new Flutter test failures introduced by this PR.

@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review and removed ai: high risk AI review classified the PR as high risk needs human review AI review or policy signals require maintainer review golden path impact AI review found possible impact to a core user flow labels Aug 31, 2026
@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review and removed ai: high risk AI review classified the PR as high risk needs human review AI review or policy signals require maintainer review golden path impact AI review found possible impact to a core user flow labels Aug 31, 2026
@sparkleMing
sparkleMing merged commit 31e1d2f into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants