Skip to content

feat(human-input): dynamic ask-user tool and resume strategy fix - #71

Merged
dsiddharth2 merged 4 commits into
Apra-Labs:mainfrom
dsiddharth2:feature/memory-human-input-integration
Oct 22, 2026
Merged

dsiddharth2 merged 4 commits into
Apra-Labs:mainfrom
dsiddharth2:feature/memory-human-input-integration

Conversation

@dsiddharth2

Copy link
Copy Markdown
Collaborator

Summary

  • Generic ask-user tool: the LLM composes its own questions dynamically as tool arguments instead of relying on hardcoded trip-preferences. Accepts both plain strings (auto-converted to text fields) and structured question objects with pick_one/pick_many/approval kinds.
  • Resume strategy fix: a paused run no longer re-routes when it resumes — executeHostedTask now reads the strategy from the checkpoint via resumeFrom, so a plan-execute run stays on plan-execute after the person answers.
  • Terminal logging: human-input pause and resume events are now visible in stderr for both the in-process and Azure Durable backends.
  • Router config: disabled trip-planner workflow routing so trip queries go through plan-execute where askUser is available.
  • Agent description: updated to instruct the LLM to call ask-user before planning and think about what information is missing from the request.

Test plan

  • npm run test:human-input — 304/304 pass
  • npm run test:checkpoint — 137/137 pass
  • npm run test:phase4 — 176/176 pass
  • node --test tests/host-human-input-demo-e2e.test.mjs — 7/7 pass
  • Manual test via npm run host → chat UI: LLM composes context-aware questions, pauses, resumes on same strategy, answers flow into final itinerary

…rminal logging

- Add generic `ask-user` tool that lets the LLM compose its own questions
  as tool arguments instead of relying on hardcoded `trip-preferences`.
  Accepts both plain strings and structured question objects.
- Fix resumed runs being re-routed: `executeHostedTask` now reads the
  strategy from `resumeFrom` so a paused plan-execute run stays on
  plan-execute after the person answers.
- Add terminal logging for human-input pause and resume events in both
  the in-process and Azure Durable backends.
- Disable trip-planner workflow routing so trip queries go through
  plan-execute where askUser is available.
- Update agentDescription to instruct the LLM to call ask-user before
  planning and think about what information is missing.
- Add explicit guardrail policy for confirm-itinerary.
- Add smoke test script and package.json entries.
- Fix test timing tolerance and expiry dates in test fixtures.
…r questions

- Pass askUser from executeHostedTask through executeWorkflow so any
  workflow tool can pause and ask the traveller questions.
- Re-enable trip-planner routing now that it asks questions before
  running the research pipeline.
- Add 6 hardcoded questions (dates, travellers, budget, interests,
  transport, must-see/avoid) to the trip-planner tool's run() as a
  starting point.
- Feed the traveller's answers into the compose prompt so the final
  itinerary reflects their preferences.
…e strategy fix

- Document the generic ask-user tool: LLM-composed dynamic questions,
  plain-string and structured-object formats, agentDescription guidance.
- Document askUser in workflows: how executeWorkflow passes it through,
  and the trip-planner as a working example.
- Document the resume strategy fix: how resumeFrom.strategy prevents
  re-routing after a pause.
- Add "Seeing it work with Fleet" section with terminal logging examples.
@dsiddharth2
dsiddharth2 merged commit 5c5b008 into Apra-Labs:main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant