Skip to content

feat: add --previous-interaction-id to research commands#75

Merged
NormallyGaussian merged 4 commits intomainfrom
feat/previous-interaction-id
Mar 12, 2026
Merged

feat: add --previous-interaction-id to research commands#75
NormallyGaussian merged 4 commits intomainfrom
feat/previous-interaction-id

Conversation

@NormallyGaussian
Copy link
Contributor

@NormallyGaussian NormallyGaussian commented Mar 12, 2026

Summary

  • Adds --previous-interaction-id option to both research run and enrich run CLI commands, enabling follow-up tasks that reuse context from a prior task
  • Surfaces interaction_id in all research output (JSON and human-readable) so users know what to pass for follow-ups
  • Threads previous_interaction_id through the full stack: CLI → core/runner → processors → batch → SDK

Test plan

  • 602 unit tests pass (4 new research tests, 1 enrichment test updated)
  • Live research chaining: research run "What is the capital of France?" then research run "What is the population of that city?" --previous-interaction-id <id> — correctly resolved "that city" as Paris
  • Live research → enrich chaining: research run "top 3 AI companies" then enrich run --data '[...]' --previous-interaction-id <id> — enrichment received context from prior research
  • Live enrich --no-wait + --previous-interaction-id — task group created successfully
  • Live research wait-mode JSON output includes interaction_id field
  • Invalid previous_interaction_id returns clear API error: "Invalid interaction id: ..." (exit code 4, no special handling needed)

Thread previous_interaction_id through the research CLI and core to
enable follow-up research that reuses context from a prior task run.

- Core: create_research_task() and run_research() accept and forward
  previous_interaction_id to the SDK; all result dicts now include
  interaction_id from the API response.
- CLI: research run accepts --previous-interaction-id; research status
  and completed output display the interaction_id with usage hints.
- Tests: 4 new tests covering the option in no-wait/wait modes, display
  in human output, and presence in JSON output.
Thread previous_interaction_id through the full enrichment pipeline:
batch.py → processors → runner → CLI.

Each run in a task group receives the same previous_interaction_id,
enabling enrichment that builds on context from a prior research or
enrichment task.
Add follow-up context reuse to features list, agent patterns section,
and a new dedicated section with step-by-step examples showing
research → research and research → enrich chaining.
Use the same help string for both research and enrich commands.
@NormallyGaussian NormallyGaussian merged commit b278e72 into main Mar 12, 2026
7 checks passed
@NormallyGaussian NormallyGaussian deleted the feat/previous-interaction-id branch March 12, 2026 22:05
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