|
1 | 1 | import { |
2 | | - CommandId, |
3 | 2 | EnvironmentId, |
4 | 3 | ThreadId, |
5 | 4 | ProjectId, |
6 | 5 | ProviderInstanceId, |
7 | 6 | MessageId, |
8 | | - TurnId, |
9 | | - type OrchestrationShellSnapshot, |
10 | 7 | type OrchestrationThreadDetailSnapshot, |
11 | 8 | type VcsListRefsResult, |
12 | 9 | } from "@t3tools/contracts"; |
@@ -154,129 +151,6 @@ describe("mobile SQLite environment cache store", () => { |
154 | 151 | }), |
155 | 152 | ); |
156 | 153 |
|
157 | | - // saveShell writes plain JSON, not the Schema encoding. This checks that |
158 | | - // loadShell decodes what it wrote. The monogram project icon is where the |
159 | | - // two encodings differ today. |
160 | | - it.effect("reads back the shell snapshot it saves", () => |
161 | | - Effect.gen(function* () { |
162 | | - const memory = makeDatabase(); |
163 | | - const store = yield* make().pipe(Effect.provideService(MobileDatabase, memory.database)); |
164 | | - const now = "2026-09-04T00:00:00.000Z"; |
165 | | - const projectId = ProjectId.make("project-1"); |
166 | | - const threadId = ThreadId.make("thread-1"); |
167 | | - const turnId = TurnId.make("turn-1"); |
168 | | - const modelSelection = { |
169 | | - instanceId: ProviderInstanceId.make("codex"), |
170 | | - model: "gpt-5.4", |
171 | | - options: [{ id: "effort", value: "high" }], |
172 | | - }; |
173 | | - const snapshot: OrchestrationShellSnapshot = { |
174 | | - snapshotSequence: 7, |
175 | | - projects: [ |
176 | | - { |
177 | | - id: projectId, |
178 | | - title: "T3 Code", |
179 | | - workspaceRoot: "/repo", |
180 | | - repositoryIdentity: { |
181 | | - canonicalKey: "github.com/pingdotgg/t3code", |
182 | | - locator: { |
183 | | - source: "git-remote", |
184 | | - remoteName: "origin", |
185 | | - remoteUrl: "https://github.com/pingdotgg/t3code.git", |
186 | | - }, |
187 | | - owner: "pingdotgg", |
188 | | - name: "t3code", |
189 | | - }, |
190 | | - defaultModelSelection: modelSelection, |
191 | | - projectIcon: { kind: "monogram", text: "T3", color: "blue" }, |
192 | | - scripts: [ |
193 | | - { |
194 | | - id: "test", |
195 | | - name: "Test", |
196 | | - command: "vp test", |
197 | | - icon: "test", |
198 | | - runOnWorktreeCreate: false, |
199 | | - }, |
200 | | - ], |
201 | | - createdAt: now, |
202 | | - updatedAt: now, |
203 | | - }, |
204 | | - ], |
205 | | - threads: [ |
206 | | - { |
207 | | - id: threadId, |
208 | | - projectId, |
209 | | - title: "Thread", |
210 | | - modelSelection, |
211 | | - runtimeMode: "full-access", |
212 | | - interactionMode: "default", |
213 | | - branch: "t3code/feature", |
214 | | - worktreePath: "/repo/.worktrees/feature", |
215 | | - pullRequests: [ |
216 | | - { |
217 | | - host: "github.com", |
218 | | - repository: "pingdotgg/t3code", |
219 | | - number: 1, |
220 | | - url: "https://github.com/pingdotgg/t3code/pull/1", |
221 | | - source: "created", |
222 | | - linkedAt: now, |
223 | | - snapshot: { |
224 | | - state: "open", |
225 | | - title: "Feature", |
226 | | - headBranch: "t3code/feature", |
227 | | - baseBranch: "main", |
228 | | - isDraft: false, |
229 | | - updatedAt: now, |
230 | | - syncedAt: now, |
231 | | - }, |
232 | | - stack: null, |
233 | | - }, |
234 | | - ], |
235 | | - latestTurn: { |
236 | | - turnId, |
237 | | - state: "running", |
238 | | - requestedAt: now, |
239 | | - startedAt: now, |
240 | | - completedAt: null, |
241 | | - assistantMessageId: MessageId.make("message-1"), |
242 | | - }, |
243 | | - createdAt: now, |
244 | | - updatedAt: now, |
245 | | - archivedAt: null, |
246 | | - settledOverride: null, |
247 | | - settledAt: null, |
248 | | - pinnedAt: now, |
249 | | - titleState: { |
250 | | - source: "generated", |
251 | | - version: CommandId.make("command-1"), |
252 | | - needsRefinement: false, |
253 | | - }, |
254 | | - session: { |
255 | | - threadId, |
256 | | - status: "running", |
257 | | - providerName: "codex", |
258 | | - providerInstanceId: ProviderInstanceId.make("codex"), |
259 | | - runtimeMode: "full-access", |
260 | | - activeTurnId: turnId, |
261 | | - lastError: null, |
262 | | - updatedAt: now, |
263 | | - }, |
264 | | - latestUserMessageAt: now, |
265 | | - hasPendingApprovals: false, |
266 | | - hasPendingUserInput: true, |
267 | | - hasActionableProposedPlan: false, |
268 | | - planProgress: { step: "Run tests", completedSteps: 1, totalSteps: 3 }, |
269 | | - }, |
270 | | - ], |
271 | | - updatedAt: now, |
272 | | - }; |
273 | | - |
274 | | - yield* store.saveShell(ENVIRONMENT_ID, snapshot); |
275 | | - |
276 | | - expect(yield* store.loadShell(ENVIRONMENT_ID)).toEqual(Option.some(snapshot)); |
277 | | - }), |
278 | | - ); |
279 | | - |
280 | 154 | it.effect("round-trips schema-validated VCS refs", () => |
281 | 155 | Effect.gen(function* () { |
282 | 156 | const memory = makeDatabase(); |
|
0 commit comments