feat(autoresearch): improve setup and run observability#3355
Conversation
Generated-By: PostHog Code Task-Id: 0ccd57ce-3e49-42eb-8de2-5b03465d559d
|
😎 Merged manually by @fercgomes - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
Reviews (1): Last reviewed commit: "feat(autoresearch): improve setup and ru..." | Re-trigger Greptile |
|
|
||
| if (session.isPromptPending) { | ||
| if (promptCount === 0) continue; | ||
| this.ingestCompletedReports(run, session); |
There was a problem hiding this comment.
Streaming Reports Become Iterations
When a turn is still streaming, this call parses any complete autoresearch block already present and recordMetricReport() immediately appends an iteration and can complete the run. If the agent later corrects the metric or emits the final report in the same turn, the dashboard records an interim value as a real iteration, burns the iteration budget, and can stop the run before the final answer arrives.
There was a problem hiding this comment.
Fixed in 69f144d. Streaming now treats the tail report as provisional. A report is recorded mid-turn only after the transcript explicitly starts the next iteration, and the final unresolved report is committed only when the turn ends. Target and iteration-budget completion decisions also run only at turn completion. Added regression coverage for corrected tail reports and multi-iteration streaming.
| endedAt: number | null, | ||
| now: number, | ||
| ): AutoresearchActivitySnapshot { | ||
| const relevant = events.filter((event) => event.ts >= startedAt); |
There was a problem hiding this comment.
Historical Runs Include Later Activity
When a completed run is selected, AutoresearchPanel still passes the current task session events into this analyzer. Since the filter only checks event.ts >= startedAt, tool calls and agent chunks from a newer run or later manual chat are included in the old run's activity list, time breakdown, and parsed plan.
| const relevant = events.filter((event) => event.ts >= startedAt); | |
| const relevant = events.filter( | |
| (event) => event.ts >= startedAt && (endedAt === null || event.ts <= endedAt), | |
| ); |
There was a problem hiding this comment.
Fixed in 69f144d. Historical activity is now bounded to events between the run start and end timestamps. Added a regression test proving later manual activity is excluded from the historical run timeline and time breakdown.
|
/trunk merge |
|
/trunk cancel |
Generated-By: PostHog Code Task-Id: 0ccd57ce-3e49-42eb-8de2-5b03465d559d
|
/trunk merge |
|
/trunk cancel |
Generated-By: PostHog Code Task-Id: 0ccd57ce-3e49-42eb-8de2-5b03465d559d
Summary
Validation
Created with Autoresearch.
Created with PostHog Code