Skip to content

feat(plugins/hitl): allow linking messages + metadata#15009

Merged
franklevasseur merged 1 commit intomasterfrom
fl_hitl_1_4_0
Mar 12, 2026
Merged

feat(plugins/hitl): allow linking messages + metadata#15009
franklevasseur merged 1 commit intomasterfrom
fl_hitl_1_4_0

Conversation

@franklevasseur
Copy link
Member

No description provided.

@franklevasseur franklevasseur requested review from a team as code owners March 12, 2026 18:00
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 12, 2026

Greptile Summary

This PR activates message linking in the HITL plugin by enabling the previously commented-out downstream, upstream, and additionalData message tags, and removes the temporary workaround in conv-manager.ts that was overriding the tags parameter with an empty object. The version is bumped from 1.3.0 to 1.4.0.

  • Message tags enabled: downstream, upstream, and additionalData message tags are now registered in the plugin definition, allowing messages forwarded between upstream and downstream conversations to carry references back to their originating messages.
  • Tags now forwarded: The respond() method in ConversationManager previously silenced all tags via const tags: Record<string, string> = {} (with a FIXME noting hub limitations). That override is now removed, so callers in before_incoming_message/all.ts can successfully tag forwarded messages with { upstream: props.data.id } (user → agent direction) and { downstream: props.data.id, additionalData: ... } (agent → user direction).
  • additionalData propagation: Metadata embedded in the downstream integration's message payload under the additionalData property is now extracted and persisted as a message tag on the upstream message, enabling richer integration-specific context to flow through.

Confidence Score: 5/5

  • This PR is safe to merge — it is a clean, well-scoped enablement of a previously blocked feature with no logic regressions.
  • The changes are minimal and surgical: one FIXME workaround removed, three tags uncommented, and a version bump. The callers in before_incoming_message/all.ts were already passing the correct tag arguments; they were simply being silently dropped before this PR. The additionalData tag value can be undefined when not present in the payload, but undefined properties are stripped during JSON serialization so this is handled gracefully. No new logic is introduced and no existing behaviour is broken.
  • No files require special attention.

Important Files Changed

Filename Overview
plugins/hitl/plugin.definition.ts Bumps plugin version from 1.3.0 to 1.4.0 and activates three previously commented-out message tags (downstream, upstream, additionalData) to enable message linking between upstream and downstream conversations.
plugins/hitl/src/conv-manager.ts Removes the FIXME workaround that was overriding the tags parameter with an empty object, allowing tags to now be forwarded to createMessage calls. Renames the previously unused _tags parameter back to tags.

Sequence Diagram

sequenceDiagram
    participant U as Upstream (User)
    participant HITL as HITL Plugin
    participant D as Downstream (Agent)

    U->>HITL: Message (upstream msg ID)
    HITL->>D: respond(payload, { upstream: props.data.id })
    Note over D: Message tagged with upstream msg ID

    D->>HITL: Message (downstream msg ID) + optional additionalData
    HITL->>U: respond(payload, { downstream: props.data.id, additionalData: ... })
    Note over U: Message tagged with downstream msg ID + metadata
Loading

Last reviewed commit: f4b920b

@franklevasseur franklevasseur merged commit a970fd4 into master Mar 12, 2026
9 checks passed
@franklevasseur franklevasseur deleted the fl_hitl_1_4_0 branch March 12, 2026 19:52
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