Skip to content

feat: enrich producer trace correlations#9

Merged
Svaag merged 1 commit into
mainfrom
feature/producer-trace-enrichment
Jun 29, 2026
Merged

feat: enrich producer trace correlations#9
Svaag merged 1 commit into
mainfrom
feature/producer-trace-enrichment

Conversation

@Svaag

@Svaag Svaag commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • enrich Engineering Loop adapter events with change/repository/PR/workflow correlation and graph-node traceback events
  • enrich Knowledge context pack trace events with CaseService/LHP correlation, repository/commit metadata, and bounded knowledge links
  • bump package version to 0.5.0 for producer adoption

Validation

  • uv run ruff check agent_core tests
  • uv run mypy agent_core
  • uv run pytest -q

@Svaag Svaag merged commit 0765283 into main Jun 29, 2026
1 check passed
@Svaag Svaag deleted the feature/producer-trace-enrichment branch June 29, 2026 20:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 105572f370

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

def _base_trace_fields(trace: Mapping[str, Any], *, run_id: str | None) -> dict[str, Any]:
raw_change = trace.get("change")
change: Mapping[str, Any] = raw_change if isinstance(raw_change, Mapping) else {}
change_id = _string_or_none(trace.get("change_id") or change.get("change_id") or run_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't synthesize change_id from run_id

When a legacy loop_trace.json has no change/change_id but the caller passes run_id, this fallback stores the run ID in change_id. The collector surfaces change_ids in run summaries and filters /v1/actions by exact change_id (agent_core/collector/app.py:210-212 and agent_core/collector/app.py:249), so runs with no actual change are advertised as if they changed run-... and can match change filters incorrectly. Leave change_id null unless the trace provides a real change identifier.

Useful? React with 👍 / 👎.

Comment on lines +95 to +96
"run_id": run_id
or _string_or_none(pack.get("run_id") or pack.get("knowledge_snapshot")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't group unrelated packs by snapshot ID

When a context pack is emitted without an explicit run_id, this uses knowledge_snapshot as the run ID. The collector groups /v1/runs solely by run_id (agent_core/collector/app.py:342-347), so every pack produced from the same export snapshot is collapsed into one run even when they are different retrieval tasks. Leave run_id unset or use a per-pack/per-execution identifier instead of the snapshot name.

Useful? React with 👍 / 👎.

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