fix: resolve task lane stale state, partial submit, and closure bugs #125

Merged
chihlasm merged 4 commits from fix/task-lane-partial-submit into main 2026-04-06 20:31:41 +00:00
chihlasm commented 2026-04-06 16:54:02 +00:00 (Migrated from github.com)

Summary

  • Stale task stateclearTaskState was exported but never called; old sessionStorage cache was overriding new AI questions on every follow-up response. Fixed in handleSend and handleTaskSubmit.
  • Partial submit drops pending tasks — tasks left unanswered (_(not yet completed)_) were silently excluded from the AI message. The AI now sees all tasks so it can carry forward unanswered ones.
  • Stale closure in backend savesaveTaskLane debounce captured questions/actions without them in the dep array; refs now ensure the backend always receives current values.
  • Missing TypeScript typepending_task_lane.responses was missing from the type, requiring an unsafe cast in selectChat. Type corrected, cast removed.
  • AI prompt — Added instruction to re-surface _(not yet completed)_ tasks in the next response unless the AI is ≥75% confident the information is no longer needed.

Test plan

  • Send a message, get tasks, answer some, submit partial — verify unanswered tasks reappear in the next AI response
  • Submit all tasks, verify lane clears when AI sends no new tasks
  • Switch chats mid-task, switch back — verify correct tasks restore from backend
  • Reload page with an active task lane session — verify state restores correctly

🤖 Generated with Claude Code

## Summary - **Stale task state** — `clearTaskState` was exported but never called; old sessionStorage cache was overriding new AI questions on every follow-up response. Fixed in `handleSend` and `handleTaskSubmit`. - **Partial submit drops pending tasks** — tasks left unanswered (`_(not yet completed)_`) were silently excluded from the AI message. The AI now sees all tasks so it can carry forward unanswered ones. - **Stale closure in backend save** — `saveTaskLane` debounce captured `questions`/`actions` without them in the dep array; refs now ensure the backend always receives current values. - **Missing TypeScript type** — `pending_task_lane.responses` was missing from the type, requiring an unsafe cast in `selectChat`. Type corrected, cast removed. - **AI prompt** — Added instruction to re-surface `_(not yet completed)_` tasks in the next response unless the AI is ≥75% confident the information is no longer needed. ## Test plan - [ ] Send a message, get tasks, answer some, submit partial — verify unanswered tasks reappear in the next AI response - [ ] Submit all tasks, verify lane clears when AI sends no new tasks - [ ] Switch chats mid-task, switch back — verify correct tasks restore from backend - [ ] Reload page with an active task lane session — verify state restores correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-04-06 16:54:28 +00:00 (Migrated from github.com)

🚅 Deployed to the resolutionflow-pr-125 environment in selfless-grace

Service Status Web Updated (UTC)
hopeful-liberation Success (View Logs) Apr 6, 2026 at 4:56 pm
patherly Success (View Logs) Apr 6, 2026 at 4:55 pm
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [resolutionflow-pr-125](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=ae42e5ba-274f-4061-9c5e-ecfe3e700f1c) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=d760328e-d84f-4378-9409-7babc74a82bf&environmentId=ae42e5ba-274f-4061-9c5e-ecfe3e700f1c)) | | Apr 6, 2026 at 4:56 pm | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=9f0f4031-f812-4e61-b22c-db6427c0b185&environmentId=ae42e5ba-274f-4061-9c5e-ecfe3e700f1c)) | | Apr 6, 2026 at 4:55 pm |
Sign in to join this conversation.