MCPcopy Index your code
hub / github.com/coder/coder / FromContext

Function FromContext

agent/agentchat/log.go:22–28  ·  view source on GitHub ↗

FromContext returns the chat identity stored on the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

20
21// FromContext returns the chat identity stored on the context.
22func FromContext(ctx context.Context) (Context, bool) {
23 chatCtx, ok := ctx.Value(chatContextKey{}).(Context)
24 if !ok || chatCtx.ID == uuid.Nil {
25 return Context{}, false
26 }
27 return chatCtx, true
28}
29
30// WithContext stores chat identity on the context for downstream logs.
31func WithContext(ctx context.Context, chatID uuid.UUID, ancestorIDs []uuid.UUID) context.Context {

Callers 9

handleStartProcessMethod · 0.92
handleListProcessesMethod · 0.92
handleProcessOutputMethod · 0.92
handleSignalProcessMethod · 0.92
HandleWriteFileMethod · 0.92
HandleEditFilesMethod · 0.92
handleWatchMethod · 0.92
extractContextForTestFunction · 0.92
FieldsFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by 1

extractContextForTestFunction · 0.74