Move to threads based system.
This commit is contained in:
@@ -100,33 +100,59 @@ export const getDetails = query({
|
||||
handler: async (ctx, { spoonId }) => {
|
||||
const ownerId = await getRequiredUserId(ctx);
|
||||
const spoon = await getOwnedSpoon(ctx, spoonId, ownerId);
|
||||
const [state, settings, latestReview, recentRuns, agentRequests] =
|
||||
await Promise.all([
|
||||
ctx.db
|
||||
.query('spoonRepositoryStates')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.first(),
|
||||
ctx.db
|
||||
.query('spoonSettings')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.first(),
|
||||
ctx.db
|
||||
.query('aiReviews')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.order('desc')
|
||||
.first(),
|
||||
ctx.db
|
||||
.query('syncRuns')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.order('desc')
|
||||
.take(10),
|
||||
ctx.db
|
||||
.query('agentRequests')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.order('desc')
|
||||
.take(10),
|
||||
]);
|
||||
return { spoon, state, settings, latestReview, recentRuns, agentRequests };
|
||||
const [
|
||||
state,
|
||||
settings,
|
||||
latestReview,
|
||||
recentRuns,
|
||||
agentRequests,
|
||||
ignoredChanges,
|
||||
] = await Promise.all([
|
||||
ctx.db
|
||||
.query('spoonRepositoryStates')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.first(),
|
||||
ctx.db
|
||||
.query('spoonSettings')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.first(),
|
||||
ctx.db
|
||||
.query('aiReviews')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.order('desc')
|
||||
.first(),
|
||||
ctx.db
|
||||
.query('syncRuns')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.order('desc')
|
||||
.take(10),
|
||||
ctx.db
|
||||
.query('agentRequests')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.order('desc')
|
||||
.take(10),
|
||||
ctx.db
|
||||
.query('ignoredUpstreamChanges')
|
||||
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
|
||||
.collect(),
|
||||
]);
|
||||
const ignoredShas = new Set(
|
||||
ignoredChanges.flatMap((change) => change.commitShas),
|
||||
);
|
||||
const effectiveUpstreamAheadBy = Math.max(
|
||||
0,
|
||||
(state?.upstreamAheadBy ?? spoon.upstreamAheadBy ?? 0) - ignoredShas.size,
|
||||
);
|
||||
return {
|
||||
spoon,
|
||||
state,
|
||||
settings,
|
||||
latestReview,
|
||||
recentRuns,
|
||||
agentRequests,
|
||||
ignoredChanges,
|
||||
effectiveUpstreamAheadBy,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -210,12 +236,18 @@ export const createManual = mutation({
|
||||
spoonId,
|
||||
ownerId,
|
||||
enabled: true,
|
||||
runtime: 'opencode',
|
||||
defaultBaseBranch: forkDefaultBranch ?? args.upstreamDefaultBranch,
|
||||
branchPrefix: 'spoon/agent',
|
||||
agentModel: 'gpt-5.1-codex',
|
||||
reasoningEffort: 'high',
|
||||
agentModel: '',
|
||||
reasoningEffort: 'medium',
|
||||
maxJobDurationMs: 1_800_000,
|
||||
maxOutputBytes: 200_000,
|
||||
envFilePath: '.env.local',
|
||||
materializeEnvFileByDefault: false,
|
||||
autoDetectCommands: true,
|
||||
allowUserFileEditing: true,
|
||||
aiProviderProfileId: undefined,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user