You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "me2seeks (via GitHub)" <gi...@apache.org> on 2026/10/21 10:02:20 UTC
[PR] fix(runtime-host): silence assistant background turn notifications [maka]
me2seeks opened a new pull request, #6220:
URL: https://github.com/apache/maka/pull/6220
## Summary
Assistant background Sessions could emit native system notifications whenever an internal turn completed, failed or waited for input. A durable task can span many such turns, and its coordinator already owns user-facing feedback.
Suppress catalog attention for Sessions carrying the durable `personal-assistant-background` label at the Host publication boundary. Keep catalog updates, terminal results and interaction state intact. This applies to Bot, delegated-task, index and discovery workers, independently of sidebar visibility, and covers both Owner and shared-session feeds without changing the wire protocol. Ordinary conversation attention and the existing incognito policy retain their behavior.
Fixes #6218
## Verification
- Runtime Host build/typecheck and prerequisite workspace builds pass.
- Complete `execution-host-message` integration suite: 13 tests pass, using real temporary Host processes and protocol clients with the deterministic backend.
- New cases cover completed and failed background turns, normal notifications after removing the background label, and background waiting-for-user state without attention. Existing ordinary completion, question, sandbox, privacy, steering and queued-message cases pass.
- Removing the label gate makes the background notification regression cases fail; restoring it passes.
- Biome check on both changed files and `git diff --check` pass.
OS toast rendering and packaged Desktop were not exercised. Existing installed Hosts and user tasks were not changed. User-facing task results and decisions continue through the coordinating assistant; this only silences worker turn notifications.
## AI use
- [ ] No generative tool made a substantive contribution
- [x] Generative tooling made a substantive contribution
Tool(s) and scope: Codex inspected the notification flow, authored the filter and integration tests, and ran the local checks.
## Checklist
- [x] Tests cover the change and fail without it
- [x] Lint, format, typecheck and the affected suites pass locally
Does this PR entail a change in behavior?
- [x] Yes — described under Summary above
- [ ] No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): silence assistant background turn notifications [maka]
Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks commented on code in PR #6220:
URL: https://github.com/apache/maka/pull/6220#discussion_r4335724320
##########
packages/runtime-host/src/__tests__/execution-host-message.test.ts:
##########
@@ -440,6 +441,54 @@ test('an unopened Session completion reaches the Host catalog feed once', async
});
});
+for (const [status, prompt] of [
+ ['completed', 'complete this worker turn'],
+ ['failed', FAKE_ERROR_PROMPT_PREFIX + 'worker failure'],
+] as const)
+ test(`assistant background turns keep catalog and ${status} facts without attention`, async () => {
+ await withExecutionRoot(async (fixture) => {
+ const host = await fixture.startHost();
+ const client = await connectClient(fixture.root);
+ const attention: unknown[] = [];
+ let catalogChanges = 0;
+ const unsubscribe = client.subscribeSessionCatalogChanges((frame) => {
+ if (frame.sessionId !== fixture.sessionId) return;
+ catalogChanges++;
+ if (frame.attention) attention.push(frame.attention);
+ });
+ // Changing the durable label is enough; sidebar visibility is not a notification policy.
+ for (const labels of [[ASSISTANT_BACKGROUND_SESSION_LABEL], []]) {
+ const catalog = await client.request('session.catalog.query', {
+ kind: 'get',
+ sessionId: fixture.sessionId,
+ });
+ assert.equal(catalog.kind, 'session');
+ if (catalog.kind !== 'session' || !catalog.session) throw Error('Session missing');
+ await client.request('session.metadata.update', {
+ sessionId: fixture.sessionId,
+ expectedRevision: catalog.session.revision,
+ patch: { labels },
+ });
+ const before = catalogChanges;
+ const turnId = randomUUID();
+ requireStartedTurn(
+ await client.request('turn.start', {
+ sessionId: fixture.sessionId,
+ turnId,
+ content: { text: prompt },
+ }),
+ );
+ const terminal = await waitForTerminalTurn(client, fixture.sessionId, turnId);
+ assert.equal(terminal.status, status);
+ assert.ok(catalogChanges > before);
+ assert.equal(attention.length, labels.length ? 0 : 1);
Review Comment:
Fixed in 7e19a88e6f. The test opens its Session subscription before starting either turn, waits for the matching terminal projection, then sends a metadata write through the same SessionAdmission lane. completeTerminalTransition holds that lane while awaiting publishTerminalProjection and its catalog callback, so the metadata response fences catalog publication for both the labelled and unlabelled assertions; it does not rely on an arbitrary delay or only on turn.query.
Validation: all 13 execution-host-message integration tests pass. With only the compiled production label guard removed, both new completed/failed cases now fail at the labelled iteration with actual 1 / expected 0; restoring the guard passes. Production notification policy is unchanged by this follow-up.
Contract clarification: this PR intentionally suppresses background catalog attention at the Host boundary for all catalog clients. Canonical terminal/interaction facts and catalog changes remain; the raw background attention field is suppressed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): silence assistant background turn notifications [maka]
Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #6220:
URL: https://github.com/apache/maka/pull/6220#discussion_r4335591330
##########
packages/runtime-host/src/__tests__/execution-host-message.test.ts:
##########
@@ -440,6 +441,54 @@ test('an unopened Session completion reaches the Host catalog feed once', async
});
});
+for (const [status, prompt] of [
+ ['completed', 'complete this worker turn'],
+ ['failed', FAKE_ERROR_PROMPT_PREFIX + 'worker failure'],
+] as const)
+ test(`assistant background turns keep catalog and ${status} facts without attention`, async () => {
+ await withExecutionRoot(async (fixture) => {
+ const host = await fixture.startHost();
+ const client = await connectClient(fixture.root);
+ const attention: unknown[] = [];
+ let catalogChanges = 0;
+ const unsubscribe = client.subscribeSessionCatalogChanges((frame) => {
+ if (frame.sessionId !== fixture.sessionId) return;
+ catalogChanges++;
+ if (frame.attention) attention.push(frame.attention);
+ });
+ // Changing the durable label is enough; sidebar visibility is not a notification policy.
+ for (const labels of [[ASSISTANT_BACKGROUND_SESSION_LABEL], []]) {
+ const catalog = await client.request('session.catalog.query', {
+ kind: 'get',
+ sessionId: fixture.sessionId,
+ });
+ assert.equal(catalog.kind, 'session');
+ if (catalog.kind !== 'session' || !catalog.session) throw Error('Session missing');
+ await client.request('session.metadata.update', {
+ sessionId: fixture.sessionId,
+ expectedRevision: catalog.session.revision,
+ patch: { labels },
+ });
+ const before = catalogChanges;
+ const turnId = randomUUID();
+ requireStartedTurn(
+ await client.request('turn.start', {
+ sessionId: fixture.sessionId,
+ turnId,
+ content: { text: prompt },
+ }),
+ );
+ const terminal = await waitForTerminalTurn(client, fixture.sessionId, turnId);
+ assert.equal(terminal.status, status);
+ assert.ok(catalogChanges > before);
+ assert.equal(attention.length, labels.length ? 0 : 1);
Review Comment:
[P2] Wait for catalog attention before asserting the unlabelled turn
On the second iteration (`labels = []`), `waitForTerminalTurn` only synchronizes the terminal query/session projection, not the separate catalog callback. `refreshCanonical` publishes the projection before awaiting `onCatalogChanged`, whose new header read adds another asynchronous step; an earlier catalog invalidation can already satisfy `catalogChanges > before`. On this head, a clean macOS build runs the full suite as 11/13 passing, with both completed/failed cases failing here at `0 !== 1`; running just these two reproduces it. Changing only the test to wait for positive attention makes both pass, confirming the notification arrives. Synchronize on the relevant catalog notification (and use a completed publication boundary for the negative assertion), rather than assuming the terminal snapshot means its notification has already been delivered. Otherwise these new tests can fail healthy builds. In a second control, removing only the production label guard actually makes both co
mpletion cases pass, while the waiting test correctly fails: the completion assertions can also miss the regression they intend to detect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): silence assistant background turn notifications [maka]
Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks merged PR #6220:
URL: https://github.com/apache/maka/pull/6220
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org