@@ -90,7 +90,7 @@ test("sessions.create stores dashboard session model and parent linkage, and cre
|
90 | 90 | expect(header.id).toBe(created.payload?.sessionId); |
91 | 91 | }); |
92 | 92 | |
93 | | -test("sessions.create inherits parent runtime model selection when model is omitted", async () => { |
| 93 | +test("sessions.create inherits parent runtime model selection without stale context metadata", async () => { |
94 | 94 | const { storePath } = await createSessionStoreDir(); |
95 | 95 | await writeSessionStore({ |
96 | 96 | entries: { |
@@ -102,6 +102,29 @@ test("sessions.create inherits parent runtime model selection when model is omit
|
102 | 102 | modelProvider: "codex", |
103 | 103 | model: "gpt-5.5", |
104 | 104 | contextTokens: 272000, |
| 105 | +inputTokens: 12000, |
| 106 | +outputTokens: 340, |
| 107 | +totalTokens: 12340, |
| 108 | +totalTokensFresh: false, |
| 109 | +contextBudgetStatus: { |
| 110 | +schemaVersion: 1, |
| 111 | +source: "pre-prompt-estimate", |
| 112 | +updatedAt: 1, |
| 113 | +provider: "codex", |
| 114 | +model: "gpt-5.5", |
| 115 | +route: "compact_then_truncate", |
| 116 | +shouldCompact: true, |
| 117 | +estimatedPromptTokens: 250000, |
| 118 | +contextTokenBudget: 128000, |
| 119 | +promptBudgetBeforeReserve: 112000, |
| 120 | +reserveTokens: 16000, |
| 121 | +effectiveReserveTokens: 16000, |
| 122 | +remainingPromptBudgetTokens: 0, |
| 123 | +overflowTokens: 138000, |
| 124 | +toolResultReducibleChars: 5000, |
| 125 | +messageCount: 12, |
| 126 | +unwindowedMessageCount: 12, |
| 127 | +}, |
105 | 128 | thinkingLevel: "off", |
106 | 129 | fastMode: "auto", |
107 | 130 | traceLevel: "debug", |
@@ -121,6 +144,11 @@ test("sessions.create inherits parent runtime model selection when model is omit
|
121 | 144 | modelProvider?: string; |
122 | 145 | model?: string; |
123 | 146 | contextTokens?: number; |
| 147 | +inputTokens?: number; |
| 148 | +outputTokens?: number; |
| 149 | +totalTokens?: number; |
| 150 | +totalTokensFresh?: boolean; |
| 151 | +contextBudgetStatus?: unknown; |
124 | 152 | thinkingLevel?: string; |
125 | 153 | fastMode?: string; |
126 | 154 | traceLevel?: string; |
@@ -142,7 +170,12 @@ test("sessions.create inherits parent runtime model selection when model is omit
|
142 | 170 | expect(created.payload?.entry?.agentRuntimeOverride).toBe("codex"); |
143 | 171 | expect(created.payload?.entry?.modelProvider).toBe("codex"); |
144 | 172 | expect(created.payload?.entry?.model).toBe("gpt-5.5"); |
145 | | -expect(created.payload?.entry?.contextTokens).toBe(272000); |
| 173 | +expect(created.payload?.entry?.contextTokens).toBeUndefined(); |
| 174 | +expect(created.payload?.entry?.inputTokens).toBeUndefined(); |
| 175 | +expect(created.payload?.entry?.outputTokens).toBeUndefined(); |
| 176 | +expect(created.payload?.entry?.totalTokens).toBeUndefined(); |
| 177 | +expect(created.payload?.entry?.totalTokensFresh).toBeUndefined(); |
| 178 | +expect(created.payload?.entry?.contextBudgetStatus).toBeUndefined(); |
146 | 179 | expect(created.payload?.entry?.thinkingLevel).toBe("off"); |
147 | 180 | expect(created.payload?.entry?.fastMode).toBe("auto"); |
148 | 181 | expect(created.payload?.entry?.traceLevel).toBe("debug"); |
|