Skip to content

Commit d891309

Browse files
Fix: context config graph id (#483)
* fix graph-id default * changeset
1 parent c032430 commit d891309

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.changeset/nine-parents-fly.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@inkeep/agents-core": patch
3+
"@inkeep/agents-sdk": patch
4+
---
5+
6+
Fix default graph id

packages/agents-core/src/context/ContextConfig.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,17 @@ export class ContextConfigBuilder<
185185
}
186186

187187
/**
188-
* Set the context (tenantId, projectId, baseURL) for this context config
188+
* Set the context (tenantId, projectId, graphId) for this context config
189189
* Called by graph.setConfig() when the graph is configured
190190
*/
191-
setContext(tenantId: string, projectId: string, graphId: string, baseURL?: string): void {
191+
setContext(tenantId: string, projectId: string, graphId: string): void {
192192
this.tenantId = tenantId;
193193
this.projectId = projectId;
194194
this.graphId = graphId;
195-
if (baseURL) {
196-
this.baseURL = baseURL;
197-
}
198195
// Update the config object as well
199196
this.config.tenantId = tenantId;
200197
this.config.projectId = projectId;
198+
this.config.graphId = graphId;
201199

202200
logger.info(
203201
{

packages/agents-sdk/src/graph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ export class AgentGraph implements GraphInterface {
151151
}
152152
}
153153

154-
// Update context config tenant ID, project ID, and baseURL if present
154+
// Update context config tenant ID, project ID, and graph ID if present
155155
if (this.contextConfig?.setContext) {
156-
this.contextConfig.setContext(tenantId, projectId, apiUrl);
156+
this.contextConfig.setContext(tenantId, projectId, this.graphId);
157157
}
158158

159159
logger.info(

0 commit comments

Comments
 (0)