Repository navigation
Host requests settle; background surfaces cannot raise sheets - #204
Conversation
App Hub 954f5da7, the merge of OctoSense-App-Hub#38 (after App Hub#44, reserved native ids and ADR 0004 storage and tool fields), makes every host request answer exactly once and carries the surface's may_prompt on ServiceCall. This moves App Hub there (native-apps.json, the root pins and the www alias patch) and takes up the new contract: - Glance tiles are a background surface: their isolates' host_prompts is false, and a swept tile cancels its waiting requests (cancel_heap). - An agent's tool call has no surface for a sheet (may_prompt: false); cancelling one stops it waiting and drops the request in App Hub. - Mail's add_account and AI providers' sheets refuse a call that cannot prompt, before touching a sign-in or sheet already under way (on main a glance tile or tool call left Mail's add_account waiting forever). - The model service allows every attempt on a provider (2 x 120 s + 30 s) before App Hub times a call out; other services keep the 60 s default. - Tests build ServiceCall with may_prompt: true, as they behaved before.
c60780f to
337f98a
Compare
… (until #204) App Hub main (58c3c8ae) includes App Hub #38: every ServiceCall carries may_prompt, and App Hub's own sheet handler refuses a sheet when it is false. Before #38 nothing read it and a sheet was always allowed. Every ServiceCall OctoSense builds (the shell's agent tool calls in script_apps.rs, and the services' tests) passes may_prompt: true, so behaviour is unchanged; no OctoSense service reads the field yet. Isolates are unchanged too: App Hub's isolate_settings now sets host_prompts true for a foreground app, so a glance tile's requests carry may_prompt true and its sheets are allowed, as today. Refusing sheets on background surfaces is #204's work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's App Hub pin (58c3c8ae, after #243) already contains 954f5da7 (App Hub#38), so this keeps main's root pins, Cargo.lock and native-apps.json, and drops the www alias [patch] section, which main no longer has. - host_tools/script_apps.rs: main's imports and check_script_app_id stay; a tool call now sets may_prompt: false (main's #243 set it to true to keep behaviour unchanged; this branch is the behaviour change). - ai-providers tests/service.rs: main's send, then this branch's send_background. - Other tests already build ServiceCall with may_prompt: true on main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Merged main into this branch (no history rewrite) at the user's request; dropped the now-superseded App Hub pin/alias hunks; targeted tests pass. Queued for the merge queue. 🤖 Generated with Claude Code |
|
Local CI passed on 5a00b65 ( GitHub would run for this PR: desktop.yml, phone.yml, apps.yml. Merged on this local pass (macOS runner queue); GitHub CI runs on the merge commit on main.
Notes:
|
|
Thanks @guofoo. This is merged now (user-approved). Here is what the two merge commits on your branch resolved, so nothing is a surprise:
Local CI (desktop, phone and apps, with the ubuntu jobs on the Linux host) passed on 5a00b65; the summary is in the comment above. |
glance_card.rs tests: kept both sides (this branch's mail card tests, main's #204 tile background-surface tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A heap key is an address, so a reopened PDF Tools could get its predecessor's key before any pdf call saw the death: the old documents then survived the sweep and filled the cap of 8. App Hub now tells services when an isolate closes (services::on_isolate_closed, called from cancel_heap; OctoSense-App-Hub#204). The pdf service registers its listener from register(), and every document bound to a closing isolate goes then, with its renders. If a call holds the table, the key waits for the next sweep, which still releases documents whose storage scope changed. - App Hub repinned to #204's head 8c86a4b9: the root Cargo.toml, native-apps.json, and the App Hub source lines in Cargo.lock. - Tests: a real isolate's closing releases its 3 documents and their renders, and a new isolate on the same key opens all 8; work goes on after each save, incremental and save-as (renders, find, text, further saves, reopen). - Docs: the known-gap text is gone from docs.rs and apps/AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A heap key is an address, so a reopened PDF Tools could get its predecessor's key before any pdf call saw the death: the old documents then survived the sweep and filled the cap of 8. App Hub now tells services when an isolate closes (services::on_isolate_closed, called from cancel_heap; OctoSense-App-Hub#204). The pdf service registers its listener from register(), and every document bound to a closing isolate goes then, with its renders. If a call holds the table, the key waits for the next sweep, which still releases documents whose storage scope changed. - App Hub repinned to #204's head 8c86a4b9: the root Cargo.toml, native-apps.json, and the App Hub source lines in Cargo.lock. - Tests: a real isolate's closing releases its 3 documents and their renders, and a new isolate on the same key opens all 8; work goes on after each save, incremental and save-as (renders, find, text, further saves, reopen). - Docs: the known-gap text is gone from docs.rs and apps/AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
App Hub #204 (services::on_isolate_closed) is merged, and its merge commit is App Hub main. The pin moves from #204's branch head 8c86a4b9 to it: the root Cargo.toml (5 crates), native-apps.json, and the five App Hub source lines of Cargo.lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A heap key is an address, so a reopened PDF Tools could get its predecessor's key before any pdf call saw the death: the old documents then survived the sweep and filled the cap of 8. App Hub now tells services when an isolate closes (services::on_isolate_closed, called from cancel_heap; OctoSense-App-Hub#204). The pdf service registers its listener from register(), and every document bound to a closing isolate goes then, with its renders. If a call holds the table, the key waits for the next sweep, which still releases documents whose storage scope changed. - App Hub repinned to #204's head 8c86a4b9: the root Cargo.toml, native-apps.json, and the App Hub source lines in Cargo.lock. - Tests: a real isolate's closing releases its 3 documents and their renders, and a new isolate on the same key opens all 8; work goes on after each save, incremental and save-as (renders, find, text, further saves, reopen). - Docs: the known-gap text is gone from docs.rs and apps/AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
App Hub #204 (services::on_isolate_closed) is merged, and its merge commit is App Hub main. The pin moves from #204's branch head 8c86a4b9 to it: the root Cargo.toml (5 crates), native-apps.json, and the five App Hub source lines of Cargo.lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Takes up OctoSense-org/OctoSense-App-Hub#38: every host request answers exactly once, and
ServiceCallcarries the surface'smay_prompt.Needs App Hub
954f5da7(the merge of #38), which main's App Hub pin already contains; this PR changes no pins.Why it matters on main today (App Hub
58c3c8aesince #243):ServiceCallsaysmay_prompt: true, an assistant's tool call included, and glance tiles keephost_promptson.ModelServicesets notimeout, so amodel.completecall is cut off at App Hub's 60 s default, although the service allows2 × 120 sper provider.Changes
app_isolatesetshost_prompts: false, andGlanceTiles::sweepcancels a gone tile's waiting requests (cancel_heap).may_prompt: false.HostServiceExecutor::cancel(call_id)now stops the wait and drops the request in App Hub, instead of keeping it until the service answers.add_accountrefuses a call that cannot prompt before it touches a sign-in already under way. On main, a tile or tool call left it waiting forever, after it had cancelled the person's own sign-in.raiserefuses the same way foradd_provider,edit_provider,import_qr,export_qrandconnect_client, and the sheet already up stays.2 × 120 s + 30 s). Other services keep App Hub's 60 s.ServiceCallwithmay_prompt: true, as they behaved before.Checks
These were run on
337f98a, before ymote's merge of main (23e71c1). The change set is unchanged:git difffrom the merge base equals a rebase on main07516e5, which compiles. Run locally on337f98a(rebased on main4e88b7d). The sources are makepada1c81312with main's runtime patch set (treecff137d1), runtime96587629and Octoscriptdbd48cfb. All 41 commands of the apps, desktop and phone workflows pass, apart from the kernel-artifact andreal_kerneljobs:setup.py --check --cargo,native_apps.py --check,test_native_apps.pyandcheck-shell-graph.sh.cargo checkfor every desktop and phone feature set.-D warningssteps.cargo test: 1794 tests, including-p octosense-app-policy -p octosense-app-hub.New tests, each of which failed before its change:
a_tiles_isolate_cannot_raise_a_sheeta_swept_tiles_requests_are_cancelleda_cancelled_tool_call_stops_waitinga_background_surface_cannot_raise_or_replace_a_sheet(AI providers)a_model_call_may_wait_out_every_attempt_on_a_provideradd_accountcase in Mail's sign-in testMerged with main
Rebased on main by ymote (with Claude Code) as a merge of
origin/maininto this branch, with no history rewrite. The App Hub pin hunks (root pins,Cargo.lock,native-apps.json) and the www-alias[patch]section were dropped as superseded: main pins App Hub58c3c8ae, which contains954f5da7. Main's #243 had already addedmay_prompt: trueto the tests and to the tool-callServiceCall; the merge keeps main's test changes and sets the tool call tomay_prompt: false, as this PR intends. The checks above were run on337f98a; after the merge, the targeted shell, AI providers and Mail tests,cargo check --lockedfor desktop and phone withmobile-apps, andsetup.py --check --cargopass on the merge,23e71c1.