Skip to content

Render AgentTab tool calls as native Tern cards in OMP - #59

Merged
wolfiesch merged 1 commit into
mainfrom
feat/omp-tern-native-cards
Oct 4, 2026
Merged

wolfiesch merged 1 commit into
mainfrom
feat/omp-tern-native-cards

Conversation

@wolfiesch

Copy link
Copy Markdown
Owner

Summary

  • Describe AgentTab tool calls and results through the OMP native card hooks (describeCall, describeResult, mergeCallAndResult) so Tern renders each browser action as one merged card.
  • Add packages/omp/src/native.ts with per-tool titles, status, and bounded detail lines; reuse the existing redaction and context metadata from render.ts.
  • Leave the Pi adapter path unchanged; the hooks register only when running under OMP.

Verification

  • bun run typecheck, bun test, and bun run build in packages/omp.
  • Loaded the built adapter in a fresh OMP session and exercised browser_tabs end to end.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T11:38:44.897711Z eca6180 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@wolfiesch
wolfiesch merged commit 34be218 into main Oct 4, 2026
14 of 16 checks passed

@wolf-maintainer wolf-maintainer 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.

P2 — coherent native-card feature and the node shapes match the OMP/TSP contracts, but this changes the default OMP presentation and needs the maintainer call.
Should fix before merge: native head/detail strings bypass existing TUI normalization and per-line bounds; the OMP-registration/Pi-isolation contract lacks coverage.
Targeted native/render tests pass; the full package suite is blocked locally because typebox is absent.
Thanks for the focused implementation.

Not anchored to diff

  • packages/omp/src/index.ts:487 — should-fix: No test reaches this registration branch. native.test.ts invokes the helpers directly, so removing describeCall, describeResult, or mergeCallAndResult—or accidentally exposing them in Pi mode—would still pass while breaking the feature and the stated "Pi adapter unchanged" contract. Extend the existing registration tests to assert all three fields in OMP mode and their absence in Pi mode.

Comment on lines +119 to +127
const meta = [
...(outcome === undefined ? [] : [outcome]),
...contextMeta({ ...card.context, taskId: undefined, owned: false }),
];
const badge = ATTENTION_BADGE[card.status];
const target = call.meta.join(" · ");
return {
title: call.title,
...(target ? { target, targetKind: "text" as const } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should-fix: These head strings bypass the terminal-safe normalization that renderHeader() applies. For example, describeCallView("browser_wait", { condition: { kind: "text", value: "A\tB" } }) emits the tab verbatim in tool.target, and an error containing a tab is copied verbatim into tool.meta. That violates the TUI contract that every render path replace tabs/control characters and bound displayed text. Normalize and truncate the native head fields before returning them.

return {
k: "section",
p: { head: [{ t: "Result", s: "muted" }, { t: " redacted", s: "dim" }], collapsible: true, collapsed: !expanded },
c: [{ k: "code", p: { text: expandedLines(payload).join("\n"), lang: "json" } }],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should-fix: expandedLines() caps only the number of lines; the ANSI renderer then truncates every line to the viewport, but this native path joins each full line directly into the TSP code node. A single long result value therefore remains a single multi-kilobyte line (and control characters other than redacted keys remain intact), contrary to the claimed bounded-detail/TUI sanitization contract. Bound each native detail line before serializing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant