-
-
Notifications
You must be signed in to change notification settings - Fork 7
Updates from Acepe session #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export function resolveResolvableToolbarModelId(input: { | ||
| readonly provisionalModelId: string | null; | ||
| readonly resolvedToolbarModelId: string | null; | ||
| }): string | null { | ||
| if (input.provisionalModelId) { | ||
| return input.provisionalModelId; | ||
| } | ||
|
|
||
| return input.resolvedToolbarModelId; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { resolveResolvableToolbarModelId } from "./resolve-resolvable-toolbar-model-id.js"; | ||
|
|
||
| describe("resolveResolvableToolbarModelId", () => { | ||
| it("keeps the explicit provisional pick before capabilities hydrate during connecting", () => { | ||
| expect( | ||
| resolveResolvableToolbarModelId({ | ||
| provisionalModelId: "claude-sonnet-4-6", | ||
| resolvedToolbarModelId: null, | ||
| }) | ||
| ).toBe("claude-sonnet-4-6"); | ||
| }); | ||
|
|
||
| it("falls back to the resolved toolbar model when no provisional pick exists", () => { | ||
| expect( | ||
| resolveResolvableToolbarModelId({ | ||
| provisionalModelId: null, | ||
| resolvedToolbarModelId: "claude-opus-4-6", | ||
| }) | ||
| ).toBe("claude-opus-4-6"); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -76,6 +76,7 @@ import { AgentPanelRootState } from "../state/agent-panel-root-state.svelte.js"; | |||||||||||||||||||||||||
| import { shouldAutoScrollOnPanelActivation } from "../logic/should-auto-scroll-on-panel-activation.js"; | ||||||||||||||||||||||||||
| import { isInteractiveClickTarget } from "../logic/panel-focus-guard.js"; | ||||||||||||||||||||||||||
| import { deriveAgentPanelHeaderDisplayTitle } from "../logic/agent-panel-header-title.js"; | ||||||||||||||||||||||||||
| import { resolveAgentPanelHeaderSequenceId } from "../logic/agent-panel-header-sequence-id.js"; | ||||||||||||||||||||||||||
| import { resolveAgentPanelProviderBrand } from "../logic/agent-panel-provider-brand.js"; | ||||||||||||||||||||||||||
| import { resolveWorktreeToggleProjectPath } from "../logic/worktree-toggle-project-path.js"; | ||||||||||||||||||||||||||
| import { buildTodoMarkdown } from "./agent-panel-pure-helpers.js"; | ||||||||||||||||||||||||||
|
|
@@ -566,7 +567,18 @@ const displayProjectName = $derived.by(() => { | |||||||||||||||||||||||||
| return effectiveProjectName ?? "Project"; | ||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const sequenceId = $derived(sessionController.sessionMetadata ? (sessionController.sessionMetadata.sequenceId ?? null) : null); | ||||||||||||||||||||||||||
| const sequenceId = $derived.by(() => { | ||||||||||||||||||||||||||
| const id = sessionId; | ||||||||||||||||||||||||||
| if (id === null) { | ||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| const pendingCreation = sessionStore.getPendingCreationSession(id); | ||||||||||||||||||||||||||
| return resolveAgentPanelHeaderSequenceId({ | ||||||||||||||||||||||||||
| sessionMetadataSequenceId: sessionController.sessionMetadata?.sequenceId, | ||||||||||||||||||||||||||
| pendingCreationSequenceId: pendingCreation?.sequenceId ?? null, | ||||||||||||||||||||||||||
| hasPendingCreationSession: sessionStore.hasPendingCreationSession(id), | ||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||
|
Comment on lines
+575
to
+580
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const displayTitle = $derived.by(() => { | ||||||||||||||||||||||||||
| return deriveAgentPanelHeaderDisplayTitle({ | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { resolveAgentPanelHeaderSequenceId } from "../agent-panel-header-sequence-id.js"; | ||
|
|
||
| describe("resolveAgentPanelHeaderSequenceId", () => { | ||
| it("prefers session metadata when sequence id is already materialized", () => { | ||
| expect( | ||
| resolveAgentPanelHeaderSequenceId({ | ||
| sessionMetadataSequenceId: 4, | ||
| pendingCreationSequenceId: 7, | ||
| hasPendingCreationSession: true, | ||
| }) | ||
| ).toBe(4); | ||
| }); | ||
|
|
||
| it("projects pending creation sequence id while metadata is absent during first-send connecting", () => { | ||
| expect( | ||
| resolveAgentPanelHeaderSequenceId({ | ||
| sessionMetadataSequenceId: undefined, | ||
| pendingCreationSequenceId: 7, | ||
| hasPendingCreationSession: true, | ||
| }) | ||
| ).toBe(7); | ||
| }); | ||
|
|
||
| it("does not project pending sequence id after pending creation completes", () => { | ||
| expect( | ||
| resolveAgentPanelHeaderSequenceId({ | ||
| sessionMetadataSequenceId: undefined, | ||
| pendingCreationSequenceId: 7, | ||
| hasPendingCreationSession: false, | ||
| }) | ||
| ).toBeNull(); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * Resolves the sequence id shown in agent panel header chrome. | ||
| * | ||
| * Today only session metadata is consulted — pending creation identity is ignored. | ||
| */ | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| export function resolveAgentPanelHeaderSequenceId(input: { | ||
| readonly sessionMetadataSequenceId: number | null | undefined; | ||
| readonly pendingCreationSequenceId: number | null | undefined; | ||
| readonly hasPendingCreationSession: boolean; | ||
| }): number | null { | ||
| if (input.sessionMetadataSequenceId != null) { | ||
| return input.sessionMetadataSequenceId; | ||
| } | ||
|
|
||
| if ( | ||
| input.hasPendingCreationSession && | ||
| input.pendingCreationSequenceId != null | ||
| ) { | ||
| return input.pendingCreationSequenceId; | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Misleading name:
dead-code:applydoes a dry-run, not an apply. Rename to signal dry-run behavior (e.g.dead-code:dry-run) and reservedead-code:applyfor the actual deletion.Prompt for AI agents