MCPcopy Create free account
hub / github.com/tiann/hapi / resetCodexThread

Method resetCodexThread

cli/src/codex/session.ts:101–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99 }
100
101 resetCodexThread(): void {
102 this.sessionId = null;
103 this.resetTranscriptPath();
104 this.client.updateMetadata((metadata: Metadata) => {
105 // Explicit-clear sentinel: `null` instructs the hub merge to
106 // drop `codexSessionId` from the persisted blob. Plain
107 // `delete` arrives at the hub as an omitted field, which the
108 // carry-forward path then restores from the prior row —
109 // defeating the reset. See hub/src/store/sessions.ts
110 // mergeSessionMetadata. The value is `null` on the wire only;
111 // MetadataSchema parses `string().optional()`, so the
112 // post-merge persisted blob carries no key.
113 const updated: Record<string, unknown> = { ...metadata, codexSessionId: null };
114 return updated as unknown as Metadata;
115 });
116 }
117
118 setPermissionMode = (mode: PermissionMode): void => {
119 this.permissionMode = mode;

Callers 1

handleSpecialCommandMethod · 0.80

Calls 2

resetTranscriptPathMethod · 0.95
updateMetadataMethod · 0.80

Tested by

no test coverage detected