Repository navigation
Conversation
Compress defaultAnalysisPrompt so it fits ASSISTANT_ANALYSIS_PROMPT_MAX_LENGTH and actually syncs. Oversized user prompts still omit rather than truncate. Fixes BasedHardware#11481
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @Jr-kenny - this is the right shape for #11481: the issue explicitly lists trimming the shipped default as an accepted alternative to raising the bound, and this keeps the backend limit, the client 10k constant, and the omit-don't-truncate protection for user-authored prompts all untouched. The compression itself is careful: comparing old and new literals section by section, the workflow, tool-use rules (search-before-extract, similarity > 0.8 duplicate/refine/already-done handling), both commitment patterns, the public-channel guard, specificity and forgettability checks, deadline rules, and the full source taxonomy all survive. Recomputing the compiled literal the way Swift strips closing-delimiter indentation gives 5,538 Unicode scalars <= 10,000, so promptForSync will now include the default in the settings PATCH.
Requesting changes for two test regressions and one description inaccuracy:
-
desktop/macos/Desktop/Tests/TaskAssistantPromptTests.swift:47 - testDefaultPromptSkipsPublicChannelRequestsNotDirectedAtUser pins five exact phrases that no longer exist in the trimmed prompt ("CRITICAL FOR PUBLIC/GROUP CHANNELS", "merely observing a public channel", "cannot tell whether the request is directed at them", "otherwise clearly addressed to the user", "questions posted to the community at large"), so five XCTAssertTrue calls will fail. The guard behavior is preserved in the new "PUBLIC/GROUP CHANNELS:" section, so the fix is to re-pin the assertions to the new phrasing, e.g. "PUBLIC/GROUP CHANNELS", "visible evidence shows the user is directly involved", "If they are only observing, or you cannot tell, call no_task_found", "Do not extract broad community bug reports or feature requests".
-
desktop/macos/Desktop/Tests/APIClientAssistantSettingsTests.swift:130 - testShippedDefaultIsOmittedFromSyncWithoutBlockingLaterHydration still asserts promptForSync(default) == nil ("the shipped default is over the bound, so it still cannot be sent"). After this PR the default fits, so promptForSync returns it and the XCTAssertNil fails. The scenario it guards (an oversized shipped default not blocking later hydration) is still worth covering for the legacy case - consider keeping it with a synthetic oversized "previous default" the way testPersistedPreviousShippedDefaultStillHydrates does, or retire it with a comment pointing there. The "shipped default is over the 10k bound" premise in the comment block at lines 93-102 is also stale now.
-
The description says "Full macOS XCTest lane is on CI for this path", but all workflows on this head are still awaiting maintainer approval to run (first PR), so nothing has executed yet - worth softening so it doesn't read as executed evidence.
Non-blocking, for a maintainer to weigh: desktop/windows/src/main/assistants/tasks/prompt.ts documents itself as the "Verbatim Mac defaultAnalysisPrompt" and still carries the full 13k version, so the two platforms' task prompts now diverge for the first time; a follow-up port (or a note in #11481) would keep that parity comment honest.
Once the two test updates land, this should be in good shape.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Point the public-channel assertions at the compressed wording, and cover the legacy oversized shipped default with a synthetic previous default so later hydration is still pinned now that the current default fits the 10k bound.
|
Pushed the requested test updates.
macOS XCTest has not run on this head yet (first-time workflow approval). The change is ready for CI once that runs. |
Prior automated change request dismissed: the two failing test assertions were re-pinned to the compressed wording and the omitted-default hydration test was rewritten with a synthetic oversized previous default (commit 45fd946).
|
Thanks @Jr-kenny — the follow-up commit resolves all three items from the earlier change request:
Recomputing the compiled literal the way Swift strips closing-delimiter indentation gives 5,538 Unicode scalars ≤ 10,000, so One remaining verification step before merge: as a first-time contributor, the workflow runs need maintainer approval, so the macOS XCTest lane hasn't actually executed on this head yet — approving the workflow run is the last thing standing between this and CI evidence. Non-blocking follow-up worth a note in #11481: by AI on behalf of David — leaving for human maintainer review for the merge decision and first-run workflow approval. |
Failure-Class: none
What changed
Fixes #11481 (prompt-reduction path)
TaskAssistantSettings.defaultAnalysisPromptwas 13,716 characters, above the 10,000 code-point bound shared withASSISTANT_ANALYSIS_PROMPT_MAX_LENGTHon the backend.SettingsSyncManager.promptForSynctherefore omitted the shipped default from every settings PATCH, so the task assistant prompt never synced.This change compresses the shipped default to 5,538 characters while keeping the extraction workflow, search rules, public-channel guard, specificity and forgettability checks, deadline rules, and source taxonomy. Oversized user-authored prompts are still omitted rather than truncated.
APIClientAssistantSettingsTestsnow asserts the shipped default fits the bound and is included in sync, instead of asserting it is oversized and omitted.No backend limit change and no deploy sequencing. Insight and memory defaults already fit.
Product invariants
How it was verified
defaultAnalysisPrompt.unicodeScalars.counton the new literal: 5,538 ≤ 10,000.testShippedTaskPromptFitsBackendSyncContractto pin fit-and-sync for the shipped default and kepttestOversizedCustomPromptIsOmittedWithoutTruncationfor user-authored overflow.