Skip to content

Commit 98a1ec8

Browse files
Merge main into feature/web-search
2 parents 2fb4c37 + 67b15f7 commit 98a1ec8

7 files changed

Lines changed: 433 additions & 40 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"agenticChat": "1.63.0"
2+
"agenticChat": "1.64.0"
33
}

chat-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@aws/chat-client-ui-types": "0.1.68",
2828
"@aws/language-server-runtimes": "^0.3.16",
2929
"@aws/language-server-runtimes-types": "^0.1.64",
30-
"@aws/mynah-ui": "^4.40.0"
30+
"@aws/mynah-ui": "^4.40.1"
3131
},
3232
"devDependencies": {
3333
"@types/jsdom": "^21.1.6",

chat-client/src/client/mynahUi.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,12 @@ export const createMynahUi = (
813813
store: tabFactory.createTab(false),
814814
},
815815
onContextCommandFilter: (tabId, searchTerm) => {
816+
// Always forward to the server. Server pulls fresh items from
817+
// the indexer on every request (no client-side cache), so the
818+
// empty-term case (@ press) returns a fresh capped list and
819+
// non-empty terms return the scored top matches.
816820
lastFilterTabId = tabId
817-
messager.onFilterContextCommands({ tabId, searchTerm })
821+
messager.onFilterContextCommands({ tabId, searchTerm: searchTerm ?? '' })
818822
},
819823
config: {
820824
maxTabs: 10,
@@ -1439,19 +1443,21 @@ ${params.message}`,
14391443
commands: toContextCommands(group.commands),
14401444
}))
14411445

1446+
const commandsWithHighlight = [
1447+
...(contextCommandGroups || []),
1448+
...(featureConfig?.get('highlightCommand')
1449+
? [
1450+
{
1451+
groupName: 'Additional commands',
1452+
commands: [toMynahContextCommand(featureConfig.get('highlightCommand'))],
1453+
},
1454+
]
1455+
: []),
1456+
]
1457+
14421458
Object.keys(mynahUi.getAllTabs()).forEach(tabId => {
14431459
mynahUi.updateStore(tabId, {
1444-
contextCommands: [
1445-
...(contextCommandGroups || []),
1446-
...(featureConfig?.get('highlightCommand')
1447-
? [
1448-
{
1449-
groupName: 'Additional commands',
1450-
commands: [toMynahContextCommand(featureConfig.get('highlightCommand'))],
1451-
},
1452-
]
1453-
: []),
1454-
],
1460+
contextCommands: commandsWithHighlight,
14551461
})
14561462
})
14571463
}

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/aws-lsp-codewhisperer/src/language-server/agenticChat/context/contextCommandsProvider.preservation.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,16 @@ describe('Preservation: Context Commands Provider Small Payload Behavior', () =>
128128
* **Validates: Requirements 3.2**
129129
*
130130
* Property 2e: For all valid context item selections, processContextCommandUpdate
131-
* sends the full payload to the webview via chat.sendContextCommands and caches items.
131+
* dispatches exactly one chat.sendContextCommands call with a contextCommandGroups
132+
* payload.
133+
*
134+
* Note: the prior version of this test also asserted that items were cached on
135+
* `cachedContextCommands`. That field was removed in `refactor: remove stale
136+
* context command cache, always pull fresh from indexer` — the server now pulls
137+
* fresh items from the indexer on every request instead of caching, so the
138+
* assertion was deleted.
132139
*/
133-
it('processContextCommandUpdate sends all items and caches them for small payloads', async () => {
140+
it('processContextCommandUpdate dispatches a single sendContextCommands payload for small payloads', async () => {
134141
await fc.assert(
135142
fc.asyncProperty(smallContextItemsArb, async items => {
136143
sendContextCommandsSpy.resetHistory()
@@ -144,10 +151,6 @@ describe('Preservation: Context Commands Provider Small Payload Behavior', () =>
144151
const sentPayload = sendContextCommandsSpy.firstCall.args[0]
145152
if (!sentPayload.contextCommandGroups) return false
146153

147-
// Cached items should match the input
148-
const cached = (provider as any).cachedContextCommands
149-
if (cached !== items) return false
150-
151154
return true
152155
}),
153156
{ numRuns: 30 }

0 commit comments

Comments
 (0)