chore(beads): close shipped production fixes
This commit is contained in:
1 parent
9c5f29411f
commit
79d810ad13
1 file changed
+3
-3
+3
-3
@@ -13,9 +13,9 @@
|
||||
{"_type":"issue","id":"archie-core-jy5m","title":"Make task timeline events operationally informative","description":"Task timelines currently render generic stage_start/stage_finish entries with no stage name or outcome, and task_retried entries add little beyond the event kind. Surface the existing event stage, workflow, detail, and relevant structured data so operators can understand what happened without opening raw logs.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T17:39:51Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:36Z","started_at":"2026-08-24T17:39:57Z","closed_at":"2026-08-24T17:55:34Z","close_reason":"Task timelines now render stage/retry context; baseline and gate-cycle logs expose useful bounded failure output. task check and independent review pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/643","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-y1hv","title":"Relay dashboard update completion through Telegram","description":"Integrate the existing Carina-side behavior so dashboard-initiated updates can deliver their post-restart watchdog result to an authorized Telegram recipient, while retaining the web UI report path fallback.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T17:18:30Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:36Z","started_at":"2026-08-24T17:18:35Z","closed_at":"2026-08-24T17:19:42Z","close_reason":"Implemented, regression-tested, full task check passed, and adversarial review finding resolved.","external_ref":"https://github.com/samcharles93/archie-core/issues/644","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-b7f1","title":"Fix Web UI session UUID compatibility and update-status synchronization","description":"The production Web UI crashes when crypto.randomUUID is unavailable, preventing chat session creation. Review and fix UUID generation compatibility plus the recovered Web UI/Telegram update-status synchronization issue, with regression tests and production-path verification.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T16:50:12Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:37Z","started_at":"2026-08-24T16:50:18Z","closed_at":"2026-08-24T17:00:21Z","close_reason":"Implemented UUIDv7 identities, replayable archived chat tool activity, and post-start update report delivery; full quality gate passes.","external_ref":"https://github.com/samcharles93/archie-core/issues/645","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-vq92","title":"task_logs truncates at 50KB with no pagination, so full logs are unreachable","description":"The task_logs chat tool caps its response at 50 KB and offers no way to fetch the rest. An operator asking the agent to retrieve or archive a task's logs gets a silently clipped window, and the agent has no mechanism to page past it. Observed 2026-08-24: asked to save a full transcript and agent logs, the agent could only produce a partial archive and had to document the truncation as a limitation rather than satisfy the request.\n\nThe failure compounds with archie-core-p1bl (errors logging as `{}`): a truncated log of uninformative errors leaves an operator with nothing at all, precisely when a task is stuck.\n\n## What is needed\n\nTruncation itself is legitimate -- a tool result must be bounded, and unbounded log text would blow the model's context. The defect is that truncation is TERMINAL: there is no continuation, no offset/cursor, no way to narrow the window, and the caller cannot tell how much was lost.\n\nEstablish first where the cap is applied (the task_logs tool in internal/gateway/task_tools.go and whatever log reader it calls in internal/logging -- note internal/logging owns the on-disk format end to end and internal/webui parses nothing, per CLAUDE.md, so the reader is the right place for range support).\n\nDesign points to decide:\n- A cursor or offset so successive calls walk the whole log, rather than always returning the same head or tail.\n- Filters that make bounded retrieval useful rather than merely possible: by level (errors only), by time range, by stage.\n- The response must state explicitly that it was truncated and how much remains, so the agent can report honestly instead of implying completeness.\n- Consider whether bulk retrieval belongs in a tool result at all, or whether the right answer for \"save the full logs\" is to write the file and deliver it via the new send_file path (archie-core-absb), keeping the tool result small.\n\n## Acceptance Criteria\n\nAn operator can obtain a task's complete logs through the agent, by paging or by file delivery; a truncated response says so and reports what remains rather than ending silently; level and time-range filtering exist so a bounded call can still answer a specific question; the cap remains enforced so no single response can exhaust the model's context; tests cover a log larger than the cap and assert that repeated calls retrieve all of it without gaps or duplication.\n","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:48:15Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:10Z","external_ref":"https://github.com/samcharles93/archie-core/issues/625","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-p1bl","title":"Task logs serialise errors to an empty object, destroying diagnostics","description":"Error values in task logs sometimes render as an empty JSON object, so the one field that says WHY something failed carries no information. Observed in production task logs 2026-08-24, in the same stream:\n\n {\"time\":\"...\",\"level\":\"ERROR\",\"message\":\"handle failed\",\"fields\":{\"err\":{}}}\n {\"time\":\"...\",\"level\":\"ERROR\",\"message\":\"handle failed\",\"fields\":{\"err\":\"stage re…\"}}\n\nSame message, same field, two different encodings -- one useful, one useless. The empty-object form is what an operator hits when diagnosing a stuck task, which is exactly when the log is the only evidence available.\n\n## Likely mechanism (to be confirmed, not assumed)\n\n`{}` is what encoding/json produces for a struct with no exported fields. A custom error type (a struct implementing `error` via a value or pointer receiver, with all fields unexported) marshals to `{}` rather than to its Error() string, because encoding/json does not consult the error interface. Errors that happen to be `*errors.errorString` or `fmt.Errorf` results go through a different path and survive as text.\n\nStart at internal/logging (attrs.go and its tests already reference a \"handle failed\" record, so the attribute handling is there) and establish where an `error` attribute is converted for the JSONL sink. The fix is to render errors through their Error() string -- and, where the error carries structured context worth keeping, to do so ADDITIONALLY rather than instead.\n\n## Why P1\n\nSam's words: \"LOGGING! ... this is another critical requirement.\" Diagnosis of every other defect depends on it. Two separate investigations this week were slowed by log output that recorded that something failed without recording what.\n\nNote this compounds archie-core-1ysw-era debugging and the parked-task investigation: an operator seeing `{\"err\":{}}` has strictly less information than one seeing no log line at all, because the empty object implies the error was captured.\n\n## Steps to Reproduce\n\n1. Arrange for a code path that logs a custom error type (unexported fields) as an `err` attribute.\n2. Read the task's JSONL log via the dashboard, /api logs, or the task_logs tool.\n3. Observe `\"err\":{}` where the message should be.\n4. Compare with a path that logs a fmt.Errorf value and observe `\"err\":\"...\"` in the same file.\n\n## Acceptance Criteria\n\nEvery error logged as an attribute renders its Error() text in the JSONL sink regardless of the concrete error type; a custom error type with only unexported fields is covered by a test asserting the message survives; structured context on an error is preserved in addition to, never instead of, the message; a regression test fails against the current encoder; no log line can report an error as an empty object.\n","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:47:44Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:11Z","external_ref":"https://github.com/samcharles93/archie-core/issues/626","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-440c","title":"Dashboard mutations 403 behind a TLS-terminating reverse proxy: Origin check ignores X-Forwarded-Proto","description":"Every operator action from the dashboard -- Stop, Cancel, Retry, Approve, Reject, Abandon, Archive -- fails with HTTP 403 in the production deployment. Observed 2026-08-24: `POST https://archie.catlow.cloud/api/tasks/3/action` returned 403 in 7ms with a 30-byte body. This left the operator with no way to stop a running task from the web UI at all.\n\n## Root cause\n\n`authorizeTaskMutation` (internal/webui/api_tasks.go:197-221) derives the expected Origin scheme from the daemon's OWN connection:\n\n wantScheme := \"http\"\n if r.TLS != nil {\n wantScheme = \"https\"\n }\n ...\n if ... || !strings.EqualFold(u.Scheme, wantScheme) || !strings.EqualFold(u.Host, r.Host) {\n http.Error(w, \"cross-origin mutation refused\", http.StatusForbidden)\n\narchied runs behind a reverse proxy that terminates TLS (confirmed: archie.catlow.cloud redirects to auth.catlow.cloud for forward auth, and the request was HTTP/2 to the proxy). The daemon therefore receives a PLAIN HTTP connection, so `r.TLS == nil` and `wantScheme == \"http\"`, while the browser correctly sends `Origin: https://archie.catlow.cloud`. Scheme mismatch -\u003e 403 on every mutation.\n\n`X-Forwarded-Proto` is never consulted anywhere in the codebase (`grep -rn 'X-Forwarded' internal/webui/ internal/config/` returns nothing).\n\n## Evidence the body confirms which branch fired\n\nThere are exactly two 403 paths in this handler. Their response bodies differ in length:\n- \"missing CSRF header\\n\" = 20 bytes\n- \"cross-origin mutation refused\\n\" = 30 bytes\n\nThe observed response was 30 B, so the Origin comparison is what rejected it, NOT the CSRF header. The dashboard is sending X-Archie-CSRF correctly.\n\n## Why this is P1\n\nIt is a total loss of the operator control surface in the supported deployment shape. It also removes the documented remedy for other faults: archie-core-0dic leaves a stopped task's row reading `running`, and `Parked`'s retry action is the stated recovery for a review that fails closed (docs/prds/adversarial-self-review.md section 4) -- both assume dashboard actions work.\n\nNote the deployment model is explicitly plural (CLAUDE.md \"Deployment model\": several supported shapes, systemd is not required), so \"runs behind a proxy\" is a first-class configuration, not an edge case.\n\n## Steps to Reproduce\n\n1. Serve archied behind any TLS-terminating reverse proxy (nginx, Caddy, Traefik, or a forward-auth proxy such as Authelia), with the daemon listening on plain HTTP.\n2. Load the dashboard over https and press Stop on a running task.\n3. Observe `POST /api/tasks/\u003cid\u003e/action` -\u003e 403, body \"cross-origin mutation refused\".\n4. The same build works when reached directly over http, or over https terminated by the daemon itself, which is why this does not reproduce in local development.\n\n## Acceptance Criteria\n\nDashboard mutations succeed when archied is behind a TLS-terminating reverse proxy; the effective scheme is derived from X-Forwarded-Proto (and the effective host from X-Forwarded-Host where applicable) ONLY when the request arrives from a trusted proxy, configured explicitly -- an unconditional trust of these headers would let any client forge the Origin check and defeat the CSRF protection this function exists to provide; direct (non-proxied) deployments keep their current strict behaviour; tests cover proxied-https, direct-http, direct-https, and a spoofed X-Forwarded-Proto from an untrusted source; the config surface and its default are documented in config.example.toml and the deployment profiles.\n","notes":"CONFIRMED LIVE against production 2026-08-25 via Playwright, signed in as the operator.\n\nReproduced the dashboard's own Stop request from the loaded page:\n\n fetch('/api/tasks/3/action', {method:'POST',\n headers:{'X-Archie-CSRF':'1','Content-Type':'application/json'},\n body:'{\"action\":\"stop\"}'})\n\nResult: status 403, body exactly \"cross-origin mutation refused\\n\" (30 bytes), with location.origin = https://archie.catlow.cloud and location.protocol = https:.\n\nThis settles which of the two 403 branches fires. The request carried a correct X-Archie-CSRF header and same-origin credentials, so it passed the CSRF check and was rejected by the Origin comparison in authorizeTaskMutation. Combined with the deployment shape (archie.catlow.cloud 302s to auth.catlow.cloud for forward auth, so TLS terminates at the proxy and the daemon sees plain HTTP), the scheme comparison is the failing term: browser Origin scheme 'https' vs the daemon's computed wantScheme 'http' from r.TLS == nil.\n\nThe dashboard confirms the operator impact at the same time: the header reads '1 running' and task #3 is still listed as running (that stale row is archie-core-0dic, a separate defect). So in production the Line truncated
|
||||
{"_type":"issue","id":"archie-core-vq92","title":"task_logs truncates at 50KB with no pagination, so full logs are unreachable","description":"The task_logs chat tool caps its response at 50 KB and offers no way to fetch the rest. An operator asking the agent to retrieve or archive a task's logs gets a silently clipped window, and the agent has no mechanism to page past it. Observed 2026-08-24: asked to save a full transcript and agent logs, the agent could only produce a partial archive and had to document the truncation as a limitation rather than satisfy the request.\n\nThe failure compounds with archie-core-p1bl (errors logging as `{}`): a truncated log of uninformative errors leaves an operator with nothing at all, precisely when a task is stuck.\n\n## What is needed\n\nTruncation itself is legitimate -- a tool result must be bounded, and unbounded log text would blow the model's context. The defect is that truncation is TERMINAL: there is no continuation, no offset/cursor, no way to narrow the window, and the caller cannot tell how much was lost.\n\nEstablish first where the cap is applied (the task_logs tool in internal/gateway/task_tools.go and whatever log reader it calls in internal/logging -- note internal/logging owns the on-disk format end to end and internal/webui parses nothing, per CLAUDE.md, so the reader is the right place for range support).\n\nDesign points to decide:\n- A cursor or offset so successive calls walk the whole log, rather than always returning the same head or tail.\n- Filters that make bounded retrieval useful rather than merely possible: by level (errors only), by time range, by stage.\n- The response must state explicitly that it was truncated and how much remains, so the agent can report honestly instead of implying completeness.\n- Consider whether bulk retrieval belongs in a tool result at all, or whether the right answer for \"save the full logs\" is to write the file and deliver it via the new send_file path (archie-core-absb), keeping the tool result small.\n\n## Acceptance Criteria\n\nAn operator can obtain a task's complete logs through the agent, by paging or by file delivery; a truncated response says so and reports what remains rather than ending silently; level and time-range filtering exist so a bounded call can still answer a specific question; the cap remains enforced so no single response can exhaust the model's context; tests cover a log larger than the cap and assert that repeated calls retrieve all of it without gaps or duplication.\n","status":"in_progress","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T15:48:15Z","created_by":"Sam Catlow","updated_at":"2026-08-25T15:03:46Z","started_at":"2026-08-25T15:03:46Z","lease_expires_at":"2026-08-25T15:08:46Z","heartbeat_at":"2026-08-25T15:03:46Z","external_ref":"https://github.com/samcharles93/archie-core/issues/625","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-p1bl","title":"Task logs serialise errors to an empty object, destroying diagnostics","description":"Error values in task logs sometimes render as an empty JSON object, so the one field that says WHY something failed carries no information. Observed in production task logs 2026-08-24, in the same stream:\n\n {\"time\":\"...\",\"level\":\"ERROR\",\"message\":\"handle failed\",\"fields\":{\"err\":{}}}\n {\"time\":\"...\",\"level\":\"ERROR\",\"message\":\"handle failed\",\"fields\":{\"err\":\"stage re…\"}}\n\nSame message, same field, two different encodings -- one useful, one useless. The empty-object form is what an operator hits when diagnosing a stuck task, which is exactly when the log is the only evidence available.\n\n## Likely mechanism (to be confirmed, not assumed)\n\n`{}` is what encoding/json produces for a struct with no exported fields. A custom error type (a struct implementing `error` via a value or pointer receiver, with all fields unexported) marshals to `{}` rather than to its Error() string, because encoding/json does not consult the error interface. Errors that happen to be `*errors.errorString` or `fmt.Errorf` results go through a different path and survive as text.\n\nStart at internal/logging (attrs.go and its tests already reference a \"handle failed\" record, so the attribute handling is there) and establish where an `error` attribute is converted for the JSONL sink. The fix is to render errors through their Error() string -- and, where the error carries structured context worth keeping, to do so ADDITIONALLY rather than instead.\n\n## Why P1\n\nSam's words: \"LOGGING! ... this is another critical requirement.\" Diagnosis of every other defect depends on it. Two separate investigations this week were slowed by log output that recorded that something failed without recording what.\n\nNote this compounds archie-core-1ysw-era debugging and the parked-task investigation: an operator seeing `{\"err\":{}}` has strictly less information than one seeing no log line at all, because the empty object implies the error was captured.\n\n## Steps to Reproduce\n\n1. Arrange for a code path that logs a custom error type (unexported fields) as an `err` attribute.\n2. Read the task's JSONL log via the dashboard, /api logs, or the task_logs tool.\n3. Observe `\"err\":{}` where the message should be.\n4. Compare with a path that logs a fmt.Errorf value and observe `\"err\":\"...\"` in the same file.\n\n## Acceptance Criteria\n\nEvery error logged as an attribute renders its Error() text in the JSONL sink regardless of the concrete error type; a custom error type with only unexported fields is covered by a test asserting the message survives; structured context on an error is preserved in addition to, never instead of, the message; a regression test fails against the current encoder; no log line can report an error as an empty object.\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:47:44Z","created_by":"Sam Catlow","updated_at":"2026-08-25T15:05:24Z","closed_at":"2026-08-25T15:05:24Z","close_reason":"Shipped in 6a23f8d: logging resolves every non-nil error attribute through Error(), with custom unexported-field and typed-nil regression coverage; included in archied v1.18.0.","external_ref":"https://github.com/samcharles93/archie-core/issues/626","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-440c","title":"Dashboard mutations 403 behind a TLS-terminating reverse proxy: Origin check ignores X-Forwarded-Proto","description":"Every operator action from the dashboard -- Stop, Cancel, Retry, Approve, Reject, Abandon, Archive -- fails with HTTP 403 in the production deployment. Observed 2026-08-24: `POST https://archie.catlow.cloud/api/tasks/3/action` returned 403 in 7ms with a 30-byte body. This left the operator with no way to stop a running task from the web UI at all.\n\n## Root cause\n\n`authorizeTaskMutation` (internal/webui/api_tasks.go:197-221) derives the expected Origin scheme from the daemon's OWN connection:\n\n wantScheme := \"http\"\n if r.TLS != nil {\n wantScheme = \"https\"\n }\n ...\n if ... || !strings.EqualFold(u.Scheme, wantScheme) || !strings.EqualFold(u.Host, r.Host) {\n http.Error(w, \"cross-origin mutation refused\", http.StatusForbidden)\n\narchied runs behind a reverse proxy that terminates TLS (confirmed: archie.catlow.cloud redirects to auth.catlow.cloud for forward auth, and the request was HTTP/2 to the proxy). The daemon therefore receives a PLAIN HTTP connection, so `r.TLS == nil` and `wantScheme == \"http\"`, while the browser correctly sends `Origin: https://archie.catlow.cloud`. Scheme mismatch -\u003e 403 on every mutation.\n\n`X-Forwarded-Proto` is never consulted anywhere in the codebase (`grep -rn 'X-Forwarded' internal/webui/ internal/config/` returns nothing).\n\n## Evidence the body confirms which branch fired\n\nThere are exactly two 403 paths in this handler. Their response bodies differ in length:\n- \"missing CSRF header\\n\" = 20 bytes\n- \"cross-origin mutation refused\\n\" = 30 bytes\n\nThe observed response was 30 B, so the Origin comparison is what rejected it, NOT the CSRF header. The dashboard is sending X-Archie-CSRF correctly.\n\n## Why this is P1\n\nIt is a total loss of the operator control surface in the supported deployment shape. It also removes the documented remedy for other faults: archie-core-0dic leaves a stopped task's row reading `running`, and `Parked`'s retry action is the stated recovery for a review that fails closed (docs/prds/adversarial-self-review.md section 4) -- both assume dashboard actions work.\n\nNote the deployment model is explicitly plural (CLAUDE.md \"Deployment model\": several supported shapes, systemd is not required), so \"runs behind a proxy\" is a first-class configuration, not an edge case.\n\n## Steps to Reproduce\n\n1. Serve archied behind any TLS-terminating reverse proxy (nginx, Caddy, Traefik, or a forward-auth proxy such as Authelia), with the daemon listening on plain HTTP.\n2. Load the dashboard over https and press Stop on a running task.\n3. Observe `POST /api/tasks/\u003cid\u003e/action` -\u003e 403, body \"cross-origin mutation refused\".\n4. The same build works when reached directly over http, or over https terminated by the daemon itself, which is why this does not reproduce in local development.\n\n## Acceptance Criteria\n\nDashboard mutations succeed when archied is behind a TLS-terminating reverse proxy; the effective scheme is derived from X-Forwarded-Proto (and the effective host from X-Forwarded-Host where applicable) ONLY when the request arrives from a trusted proxy, configured explicitly -- an unconditional trust of these headers would let any client forge the Origin check and defeat the CSRF protection this function exists to provide; direct (non-proxied) deployments keep their current strict behaviour; tests cover proxied-https, direct-http, direct-https, and a spoofed X-Forwarded-Proto from an untrusted source; the config surface and its default are documented in config.example.toml and the deployment profiles.\n","notes":"CONFIRMED LIVE against production 2026-08-25 via Playwright, signed in as the operator.\n\nReproduced the dashboard's own Stop request from the loaded page:\n\n fetch('/api/tasks/3/action', {method:'POST',\n headers:{'X-Archie-CSRF':'1','Content-Type':'application/json'},\n body:'{\"action\":\"stop\"}'})\n\nResult: status 403, body exactly \"cross-origin mutation refused\\n\" (30 bytes), with location.origin = https://archie.catlow.cloud and location.protocol = https:.\n\nThis settles which of the two 403 branches fires. The request carried a correct X-Archie-CSRF header and same-origin credentials, so it passed the CSRF check and was rejected by the Origin comparison in authorizeTaskMutation. Combined with the deployment shape (archie.catlow.cloud 302s to auth.catlow.cloud for forward auth, so TLS terminates at the proxy and the daemon sees plain HTTP), the scheme comparison is the failing term: browser Origin scheme 'https' vs the daemon's computed wantScheme 'http' from r.TLS == nil.\n\nThe dashboard confirms the operator impact at the same time: the header reads '1 running' and task #3 is still listed as running (that stale row is archie-core-0dic, a separate defect). So in production the Line truncated
|
||||
{"_type":"issue","id":"archie-core-0dic","title":"Stopped tasks stay 'running' forever: terminal writes ride the cancelled context","description":"/stop reports success and genuinely does stop the container, but the task row is never updated, so the dashboard, /status and task_list all show the task as running indefinitely. Observed 2026-08-24: task #3 was stopped and was still displayed as running the following day.\n\n## Root cause\n\n`Daemon.runViaAgent` (internal/daemon/daemon.go:1010-1100) writes its terminal state with the SAME context that was just cancelled, and discards the result:\n\n reply, err := d.requestTaskRun(ctx, task.ID, data) // returns ctx.Err() on /stop\n if err != nil {\n _ = d.Store.Transition(ctx, task.ID, store.StatusRunning, store.StatusParked, \"taskrun request failed: \"+err.Error())\n\n`store.Transition` writes through `tx.ExecContext(ctx, ...)` (internal/store/store.go:358-365), so on a cancelled context the write fails immediately and the `_ =` throws the error away. The row stays `running` with nothing left to correct it.\n\nThere are SIX such writes in runViaAgent (grant unavailable, grant failed, encode failed, request failed, decode failed, run failed). Every one is unreachable in exactly the situation it exists for -- cancellation -- because cancellation is what invalidates the context it writes with.\n\n`cleanupTerminalTaskWorktree` (daemon.go:897) has the same defect: it re-reads via `d.Store.TaskByID(ctx, ...)` and returns early on error, so a cancelled task also skips worktree cleanup.\n\n## Why the container is NOT the problem\n\n`Pool.Release` already gets this right and is the precedent for the fix: it detaches deliberately with `context.WithTimeout(context.WithoutCancel(ctx), 10*time.Second)` and documents why -- \"the most important reason a task is on its way out is that it was cancelled... Teardown is cleanup, so it gets its own deadline rather than inheriting the caller's cancellation.\" So teardown works; only state recording is broken.\n\n## Contributing factor\n\n`StoreTaskController.StopRunning` (internal/gateway/tasks.go:227) deliberately writes no terminal state, documented as \"A stopped task unwinds through its own error paths and lands wherever that leaves it, usually parked\". That assumption is now false: the unwind path cannot record anything, so nothing lands. Note `CancelChatTask` (the /cancel path) DOES write state explicitly and is unaffected.\n\n## Steps to Reproduce\n\n1. Start an autonomous task so it reaches `running` with a live archie-agent container.\n2. Issue `/stop` from chat (or Stop from the dashboard).\n3. Observe the container is stopped and removed by Pool.Release.\n4. Observe the task row is still `status = running` in the store, in `task_list`, in `/status` and on the dashboard.\n5. Wait: nothing ever corrects it. Only a daemon restart re-queues it, via the crash-recovery path that re-queues tasks left `running`.\n\n## Acceptance Criteria\n\nTerminal state writes on the cancellation path use a context that survives cancellation (`context.WithoutCancel`, with its own timeout, mirroring Pool.Release); their errors are logged rather than discarded; a stopped task reaches a terminal state observable in the store, task_list and the dashboard without a daemon restart; cleanupTerminalTaskWorktree also runs for a cancelled task; a regression test cancels a task mid-run and asserts the row is no longer `running`, and fails against the current code.\n","notes":"Timeline correction: the task was observed still 'running' roughly ONE HOUR after /stop, not a day (an earlier note said a day; that was inferred wrongly from a date rollover). An hour is if anything stronger evidence, since no plausible refresh interval covers it.\n\nChronology correction: the agent's pre-/stop task_list reading 'still marked running' is NOT evidence of this bug -- nothing had stopped the task at that point, so it was reporting correctly. The genuine evidence is (a) the row still 'running' an hour after /stop, and (b) the code path itself, which predicts exactly that and was found by reading runViaAgent rather than from the transcript.\n\nScope note: this bug explains a stale ROW only. It does not explain a still-live container, because container.Pool.Release deliberately detaches from the cancelled context and does tear down. If a container is ever found alive after /stop, that is a SEPARATE defect, not this one.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T15:22:19Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:13Z","started_at":"2026-08-24T15:31:34Z","closed_at":"2026-08-24T15:42:47Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/628","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-ite6","title":"Flush daemon task-event subscription before accepting worker events","description":"cmd/archied.subscribeAgentEvents registers a core-NATS wildcard subscription but returns before flushing the SUB frame. A task worker can publish immediately and lose its first event; TestSubscribeAgentEventsDropsUnparseableMessages exposes the race under full-suite load.","acceptance_criteria":"subscribeAgentEvents flushes the NATS connection before returning; flush failure unsubscribes the just-created subscription; a regression test proves a publisher can deliver immediately after subscription setup.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T04:39:22Z","created_by":"Sam Catlow","updated_at":"2026-08-24T05:19:34Z","started_at":"2026-08-24T04:39:24Z","closed_at":"2026-08-24T05:19:34Z","close_reason":"Completed; reconciled with the already-closed GitHub issue.","external_ref":"https://github.com/samcharles93/archie-core/issues/616","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-q15y.3","title":"Remove legacy inprocess subprocess and single-stage agent execution","description":"The configuration and worker still expose daemon inprocess, per-stage subprocess, and single-stage NATS execution paths. Remove those production choices and keep the agent-loop runner owned only by the full-task archie-agent worker.","acceptance_criteria":"agent.mode no longer selects inprocess/subprocess/nats production behavior; cmd/archied and internal/daemon cannot construct an agent loop runner; legacy SubprocessRunner and single-stage worker paths are deleted or proven test-only; architecture tests enforce worker-only ownership.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:30Z","started_at":"2026-08-24T03:49:36Z","closed_at":"2026-08-24T06:58:30Z","close_reason":"Implemented in 157e99b (refactor(agentexec): remove legacy execution paths); [agent] is decode-only. Verified: no SubprocessRunner/inprocess symbols in non-test code.","external_ref":"https://github.com/samcharles93/archie-core/issues/617","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.3","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.3","depends_on_id":"archie-core-q15y.2","type":"blocks","created_at":"2026-08-24T03:03:52Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
|
||||
|
||||
Reference in new issue
Block a user