Skip to content

Commit f01a094

Browse files
authored
Disable gloabl tracing (#3196)
## Description - Disable global tracing. - Remove reference to message history v1. - Add localStorage key to use a different localstroage to get messages in local development.
1 parent e5d0c80 commit f01a094

7 files changed

Lines changed: 35 additions & 24 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/botonic-plugin-ai-agents/CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to Botonic will be documented in this file.
1010
Click to see more.
1111
</summary>
1212

13-
## [0.46.x] - 2026-mm-dd
13+
## [0.47.x] - 2026-mm-dd
1414

1515
### Added
1616

@@ -20,6 +20,19 @@ All notable changes to Botonic will be documented in this file.
2020

2121
</details>
2222

23+
## [0.47.1] - 2026-03-31
24+
25+
- [PR-3196](https://github.com/hubtype/botonic/pull/3196): Disable global sdk tracing.
26+
27+
### Added
28+
29+
## [0.47.0] - 2026-03-30
30+
31+
[PR-3190](https://github.com/hubtype/botonic/pull/3190): getInference accept a new parm with previousMessages that backend has not yet received.
32+
33+
### Added
34+
35+
2336
## [0.46.2] - 2026-03-26
2437

2538
### Fixed

packages/botonic-plugin-ai-agents/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@botonic/plugin-ai-agents",
3-
"version": "0.47.0",
3+
"version": "0.47.1",
44
"main": "./lib/cjs/index.js",
55
"module": "./lib/esm/index.js",
66
"description": "Use AI Agents to generate your contents",

packages/botonic-plugin-ai-agents/src/index.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
Plugin,
66
ResolvedPlugins,
77
} from '@botonic/core'
8-
import { tool } from '@openai/agents'
8+
import { setTracingDisabled, tool } from '@openai/agents'
99
import { v7 as uuidv7 } from 'uuid'
1010
import { AIAgentBuilder } from './agent-builder'
1111
import {
@@ -24,7 +24,6 @@ import type {
2424
CustomTool,
2525
InferenceResponse,
2626
MemoryOptions,
27-
MessageHistoryApiVersion,
2827
PluginAiAgentOptions,
2928
Tool,
3029
} from './types'
@@ -35,31 +34,25 @@ export default class BotonicPluginAiAgents<
3534
> implements Plugin
3635
{
3736
private readonly authToken?: string
38-
private readonly messageHistoryApiVersion: MessageHistoryApiVersion
3937
private readonly memory: MemoryOptions
4038
private readonly logger: DebugLogger
4139
private readonly timeout: number
4240
private readonly maxRetries: number
4341
public toolDefinitions: CustomTool<TPlugins, TExtraData>[] = []
42+
private readonly localStorageKey: string
4443

4544
constructor(options?: PluginAiAgentOptions<TPlugins, TExtraData>) {
46-
if (options?.messageHistoryApiVersion === 'v1' && options?.memory) {
47-
throw new Error(
48-
'Cannot use memory when messageHistoryApiVersion is "v1". ' +
49-
'Either set messageHistoryApiVersion to "v2" or remove memory.'
50-
)
51-
}
52-
5345
this.authToken = options?.authToken
5446
this.toolDefinitions = options?.customTools || []
55-
this.messageHistoryApiVersion = options?.messageHistoryApiVersion ?? 'v2'
5647
this.memory = this.getMemoryOptions(options?.memory)
5748
this.timeout = options?.timeout ?? DEFAULT_TIMEOUT_16_SECONDS
5849
this.maxRetries = options?.maxRetries ?? DEFAULT_MAX_RETRIES
5950
this.logger = createDebugLogger(options?.enableDebug ?? false)
51+
this.localStorageKey = options?.localStorageKey ?? 'botonicState'
52+
setTracingDisabled(true)
6053

6154
this.logger.logInitialConfig({
62-
messageHistoryApiVersion: this.messageHistoryApiVersion,
55+
messageHistoryApiVersion: 'v2',
6356
maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,
6457
timeout: options?.timeout ?? DEFAULT_TIMEOUT_16_SECONDS,
6558
customToolNames: this.toolDefinitions.map(t => t.name),
@@ -185,7 +178,8 @@ export default class BotonicPluginAiAgents<
185178
if (!isProd) {
186179
return await hubtypeClient.getLocalMessages(
187180
MAX_MEMORY_LENGTH,
188-
previousHubtypeMessages
181+
previousHubtypeMessages,
182+
this.localStorageKey
189183
)
190184
}
191185

packages/botonic-plugin-ai-agents/src/services/hubtype-api-client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ export class HubtypeApiClient {
4646

4747
async getLocalMessages(
4848
maxMemoryLength: number,
49-
previousHubtypeMessages: HubtypeAssistantMessage[]
49+
previousHubtypeMessages: HubtypeAssistantMessage[],
50+
localStorageKey: string
5051
): Promise<AgenticInputMessage[]> {
5152
const localBotonicState =
5253
typeof globalThis !== 'undefined' && globalThis.localStorage
53-
? globalThis.localStorage.getItem('botonicState')
54+
? globalThis.localStorage.getItem(localStorageKey)
5455
: null
5556
const botonicState = JSON.parse(localBotonicState || '{}')
5657
const messages = botonicState.messages

packages/botonic-plugin-ai-agents/src/types.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ export type AIAgent<
6666
TExtraData = any,
6767
> = Agent<Context<TPlugins, TExtraData>, AgentOutputType<typeof OutputSchema>>
6868

69-
export type MessageHistoryApiVersion = 'v1' | 'v2'
70-
7169
export interface MemoryOptions {
7270
maxMessages: number
7371
includeToolCalls: boolean
@@ -83,12 +81,11 @@ export interface PluginAiAgentOptions<
8381
customTools?: CustomTool<TPlugins, TExtraData>[]
8482
maxRetries?: number
8583
timeout?: number
86-
/** API version for message history endpoint. Defaults to 'v2'. */
87-
messageHistoryApiVersion?: MessageHistoryApiVersion
88-
/** Options for V2 message history API. Only used when messageHistoryApiVersion is 'v2'. */
8984
memory?: Partial<MemoryOptions>
9085
/** Enable debug logging for AI agent configuration and execution details. */
9186
enableDebug?: boolean
87+
/** Key for the local storage to to get messages in local development mode */
88+
localStorageKey?: string
9289
}
9390

9491
export interface ResultRawResponse {

packages/botonic-plugin-flow-builder/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to Botonic will be documented in this file.
1010
Click to see more.
1111
</summary>
1212

13-
## [0.46.x] - 2026-mm-dd
13+
## [0.47.x] - 2026-mm-dd
1414

1515
### Added
1616

@@ -20,6 +20,12 @@ All notable changes to Botonic will be documented in this file.
2020

2121
</details>
2222

23+
## [0.47.0] - 2026-03-30
24+
25+
### Added
26+
27+
[PR-3190](https://github.com/hubtype/botonic/pull/3190): Allow as follow up a GoToFlow with Ai Agents flow.
28+
2329
## [0.46.2] - 2026-03-20
2430

2531
### Added

0 commit comments

Comments
 (0)