fix(aws): stop guard review round 1

The stop guard's choice now reaches the workspace: after a successful
push (or for Stop without pushing) the app records pushed/discard in
/run/triple-c/stop-reason as root, and the entrypoint's shutdown hook
then skips its own push; a marker that can't be written is reported
and the stop goes on. The push runs before the auth bridge is stopped;
a guarded stop of a workspace that already stopped succeeds. The
Fargate table allows only 512/1024/2048 MiB with 256 CPU, pinned on
both sides by a shared fixture. Removal's missing-connection refusal
carries a stable prefix. OpenAI Compatible is allowed on AWS, with a
warning for local addresses and the app's own gateway. HostSection
locks resource actions unless Stopped, the add dialog drops the
environment on a region change, and the repository editor keeps rows
in progress across a refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Opus 5.5 committed 2026-11-15 10:26:53 -08:00
1 parent eb7c6c7b21
commit 8441a096c8
26 files changed
+780 -193

No files matched your search

+16
View File
@@ -99,6 +99,22 @@ describe("useProjectActions stop guard", () => {
});
});
describe("useProjectActions stop notes", () => {
it("tells the user when the choice could not be recorded in the workspace", async () => {
checkUnsavedWork.mockResolvedValue(dirty);
stop.mockResolvedValue("its own push of work in progress on shutdown may still run");
const { result } = renderHook(() => useProjectActions(awsProject({ status: "running" })));
await act(async () => {
await result.current.handleStop();
});
await act(async () => {
await result.current.resolveStopGuard("discard");
});
expect(stop).toHaveBeenCalledWith("p1", "discard");
expect(toasts().at(-1)?.detail).toMatch(/may still run/);
});
});
describe("useProjectActions start", () => {
it("adds the task's last log lines to an AWS start failure", async () => {
start.mockRejectedValue("The task stopped: Essential container exited");
+6 -2
View File
@@ -108,9 +108,13 @@ export function useProjectActions(project: Project) {
(choice: WipChoice | null) => {
setStopGuard(null);
if (choice === null) return undefined;
return run("Stop", () => stop(project.id, choice));
return run("Stop", async () => {
const note = await stop(project.id, choice);
if (note) pushToast({ kind: "info", message: `“${project.name}” stopped`, detail: note });
return note;
});
},
[run, stop, project.id],
[run, stop, project.id, project.name, pushToast],
);
const handleReset = useCallback(
+2 -1
View File
@@ -126,9 +126,10 @@ export function useProjects() {
const stop = useCallback(
(id: string, wip?: WipChoice) =>
withOptimisticStatus(id, "stopping", async () => {
await commands.stopProjectContainer(id, wip);
const note = await commands.stopProjectContainer(id, wip);
const list = await commands.listProjects();
setProjects(list);
return note;
}),
[setProjects, withOptimisticStatus],
);