Skip to content

Enhance Canvas, Remote Workspace, and File Explorer Features - #113

Merged
SWangHash merged 1 commit into
mainfrom
wc/rebase_5
Jul 7, 2026
Merged

SWangHash merged 1 commit into
mainfrom
wc/rebase_5

Conversation

@SWangHash

Copy link
Copy Markdown
Owner

…ation

Summary

Fixes #

Type and Areas

Type:

Areas:

Motivation / Impact

Verification

Reviewer Notes

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@SWangHash
SWangHash merged commit 7e6d9c8 into main Jul 7, 2026
1 check failed
SWangHash pushed a commit that referenced this pull request Sep 3, 2026
fix(ai): force manual subscription token refresh

Created-by: guantw
Commit-by: guantw
Merged-by: SWangHash
Description: ## Summary

Port the Codex subscription reliability fixes from `release/1.0.5` to `main`.

- Keep OAuth credential chunks within HarmonyOS AssetStoreKit's 1024-byte `asset.Tag.SECRET` limit after base64 encoding.
- Add GPT-5.6 to the Codex discovery fallback and retry one transient model-catalog failure with bounded per-attempt timeouts before using the local catalog.
- Make explicit Codex and Antigravity refresh actions renew OAuth tokens even when the cached access token is still valid, while preserving near-expiry refresh behavior for normal runtime credential resolution.
- Restrict the Windows `/STACK:8388608` linker argument to Windows MSVC targets and restore the HarmonyOS downloads API wrapper used by the Web UI.
- Add regression coverage for AssetStore chunk sizing, initial model backfill, transient model-discovery retry, and forced-versus-automatic token refresh decisions.

## Type and Areas

Type: Bug fix / regression fix

Areas: HarmonyOS, AI adapters, subscription authentication, desktop/Tauri build, Web UI infrastructure

## Motivation / Impact

HarmonyOS AssetStoreKit rejects secret values larger than 1024 bytes. The previous portable credential chunk size could exceed that limit after the OHOS bridge encoded it as base64, causing Codex OAuth persistence to fail with a secure credential store `401` error.

Initial Codex model discovery could also fall back too early after a transient connection, timeout, incomplete-body, decode, or retryable HTTP failure. This could leave users with only the built-in model list until a later refresh. Discovery now makes at most two bounded attempts and still preserves the existing fallback for non-retryable or exhausted failures.

Finally, an explicit user refresh previously reused an unexpired cached token and could appear to do nothing. Manual Codex and Antigravity refreshes now force OAuth renewal, while background credential resolution keeps the existing near-expiry policy.

## Verification

- `rustfmt --edition 2021 --check` for the six changed Rust files — passed on the `main` port branch.
- `git diff --check source/main...HEAD` — passed.
- `git show --check --oneline 8447af3`, `22ab96aad`, and `d944ec2c4` — passed.
- `cargo test -p bitfun-ai-adapters codex_model_discovery_retries_an_incomplete_first_response --locked` — attempted, but the current workspace lockfile requires an update before Cargo will compile; `Cargo.lock` was intentionally left unchanged.
- The first two source changes were previously exercised on `release/1.0.5` in PRs #109 and #113 with the `bitfun-ai-adapters` test suite and HarmonyOS HAP/device validation. The final manual-refresh increment has formatting and static diff validation only in this port.

## Reviewer Notes

- This PR ports the functional increments from #109 and #113 onto `main` as three focused commits.
- New credential writes use 768-byte raw chunks, which encode to at most 1024 base64 bytes; existing chunked records remain readable through their stored part counts.
- Model discovery retries only transient failures, once, with an independent 12-second timeout per attempt and a 250 ms delay.
- Explicit refresh uses a force policy; runtime credential lookup continues to refresh only near expiry.
- No live `main`-branch HarmonyOS package, remote-workspace, remote-control, peer-device, or detached-dispatch end-to-end run was performed.

## Checklist

- [x] This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
- [x] Relevant verification is recorded above, or skipped checks are explained.
- [x] User-facing strings, docs, and locales are updated where applicable.

See merge request: OpenHarmonyPCDeveloper/BitFun!114
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