feat(sdk): let a builder tool call carry the agent's own note - #5747
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds opt-in ephemeral descriptions to selected platform operations. Metadata flows through callback specifications to the runner, which strips descriptions before dispatch while retaining them for records. The web interface displays trimmed descriptions beneath tool activity rows. ChangesEphemeral descriptions
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Model
participant PlatformOp
participant Runner
participant API
participant ToolActivity
Model->>PlatformOp: provide optional description
PlatformOp->>Runner: send resolved ephemeralArgs metadata
Runner->>API: dispatch request without ephemeral description
Runner->>ToolActivity: retain tool input for recorded activity
ToolActivity->>ToolActivity: extract and render description
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| * | ||
| * Returns `args` unchanged when there is nothing to strip, so the common path allocates nothing. | ||
| */ | ||
| export function stripEphemeralArgs( |
There was a problem hiding this comment.
The strip happens at dispatch. It does not happen earlier.
The recorded call keeps the full arguments. The frontend reads the note from the recorded call, on the live path and on the replay path.
If you strip the field earlier, the note disappears from the conversation after a reload.
| // `description`, R12). This runs BEFORE the dispatch fork so both modes strip identically, and | ||
| // before `assembleBody` so an `args_into` op cannot deep-set the note inside its payload. The | ||
| // recorded call and the approval card keep the full arguments; only the request loses them. | ||
| const dispatchArgs = stripEphemeralArgs(req.args, spec.ephemeralArgs); |
There was a problem hiding this comment.
This call precedes the fork between the two dispatch modes. Both modes therefore strip the same fields.
The call also precedes assembleBody. An op with args_into writes the arguments into a payload object. A strip after that step could leave the note inside the payload.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/oss/src/components/AgentChatSlice/assets/toolDisplay.ts (1)
86-91: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReduce the new multi-line comments.
Neither comment documents a bug, race, or ordering constraint. Replace each with one short line or remove it.
web/oss/src/components/AgentChatSlice/assets/toolDisplay.ts#L86-L91: reduce the helper comment to one short line.web/oss/src/components/AgentChatSlice/assets/toolDisplay.test.ts#L5-L6: reduce the test-context comment to one short line.As per coding guidelines, “Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7bbfb00b-9ec4-4752-aad7-c41c4f234b1e
📒 Files selected for processing (12)
sdks/python/agenta/sdk/agents/platform/op_catalog.pysdks/python/agenta/sdk/agents/platform/platform_tools.pysdks/python/agenta/sdk/agents/tools/models.pysdks/python/oss/tests/pytest/unit/agents/platform/test_op_catalog.pysdks/python/oss/tests/pytest/unit/agents/platform/test_op_catalog_description.pyservices/runner/src/protocol.tsservices/runner/src/tools/direct.tsservices/runner/src/tools/relay.tsservices/runner/tests/unit/tool-direct.test.tsweb/oss/src/components/AgentChatSlice/assets/toolDisplay.test.tsweb/oss/src/components/AgentChatSlice/assets/toolDisplay.tsweb/oss/src/components/AgentChatSlice/components/ToolActivity.tsx
fc8740d to
dabe419
Compare
216ab63 to
447c544
Compare
dabe419 to
8886dd9
Compare
447c544 to
829b266
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 86055eba-8a93-4b56-b1e9-92fe45bcd89b
📒 Files selected for processing (12)
sdks/python/agenta/sdk/agents/platform/op_catalog.pysdks/python/agenta/sdk/agents/platform/platform_tools.pysdks/python/agenta/sdk/agents/tools/models.pysdks/python/oss/tests/pytest/unit/agents/platform/test_op_catalog.pysdks/python/oss/tests/pytest/unit/agents/platform/test_op_catalog_description.pyservices/runner/src/protocol.tsservices/runner/src/tools/direct.tsservices/runner/src/tools/relay.tsservices/runner/tests/unit/tool-direct.test.tsweb/oss/src/components/AgentChatSlice/assets/toolDisplay.test.tsweb/oss/src/components/AgentChatSlice/assets/toolDisplay.tsweb/oss/src/components/AgentChatSlice/components/ToolActivity.tsx
🚧 Files skipped from review as they are similar to previous changes (11)
- web/oss/src/components/AgentChatSlice/components/ToolActivity.tsx
- sdks/python/agenta/sdk/agents/tools/models.py
- services/runner/src/tools/relay.ts
- web/oss/src/components/AgentChatSlice/assets/toolDisplay.ts
- services/runner/tests/unit/tool-direct.test.ts
- sdks/python/oss/tests/pytest/unit/agents/platform/test_op_catalog.py
- services/runner/src/tools/direct.ts
- services/runner/src/protocol.ts
- sdks/python/agenta/sdk/agents/platform/op_catalog.py
- sdks/python/agenta/sdk/agents/platform/platform_tools.py
- sdks/python/oss/tests/pytest/unit/agents/platform/test_op_catalog_description.py
8886dd9 to
df3dc1e
Compare
829b266 to
f07fa00
Compare
Railway Preview Environment
Updated at 2026-08-07T09:42:44.561Z |
df3dc1e to
1a5e248
Compare
dbc47ba to
b364fbf
Compare
1a5e248 to
8fe8b6c
Compare
b364fbf to
7f97902
Compare
8fe8b6c to
98b9826
Compare
7f97902 to
bc0e91a
Compare
98b9826 to
9abf2a0
Compare
bc0e91a to
06525cc
Compare
9abf2a0 to
2c90d37
Compare
06525cc to
521cdc4
Compare
Builder ops accept an optional ephemeral description. The runner strips it from the arguments before dispatch on both branches (spec-level strip, before assembleBody, so args_into cannot fold it into the payload). The agent chat tool card shows it. Also corrects a misleading assembleBody docstring: an unresolved binding throws, it is not left unset.
…e catalog cap (CodeRabbit)
…isplay override under Claude)
2c90d37 to
4a24d43
Compare
521cdc4 to
26f59ea
Compare
feat(sdk): let a builder tool call carry the agent's own note
Context
When a build-kit agent commits a change or runs a test, the playground shows the call and its arguments. It does not show why the agent made it. The user watching a tool call scroll past has to read a JSON payload and infer the intent.
This adds one optional field the model writes and the human reads: a sentence or two saying what this call does and why.
Changes
Builder ops opt in with
accepts_descriptionon the catalog entry.commit_revisionandtest_runcarry it. An op whose calls no human ever sees gains nothing from it, so it stays off by default.The field rides at the top level of the arguments, beside the op's own payload object, because it describes the call and not the payload:
{"description": "Adding the release checklist skill so I can run the checks myself.", "workflow_revision": {"delta": {"operations": [...]}}}The endpoint never sees it. The runner deletes it from the model's arguments at dispatch, before it builds the request, so no endpoint schema changes and no persisted record grows a field. The strip runs at dispatch and not earlier for one reason: the recorded call keeps the full arguments, so the frontend shows the note on both the live path and the replay path.
The list of fields to strip lives on the resolved tool spec as
ephemeralArgs, next to the schema that offers the field. One list means the schema and the strip cannot drift apart, and both dispatch modes call the same strip.This is not the commit message and not the persisted
description. The commit message describes the change in the revision history and is derived by the server from the operations. This describes the call in the conversation and is never saved. The catalog caps it at 500 characters, which is long enough for two sentences and short enough that it can never become a payload channel. The frontend truncates at the same number and shows that it truncated.The playground renders it under the tool name in the activity list, in secondary text. It is model-authored text, so it is presented as the agent's own account of the call and never as a fact about what happened.
Tests / notes
test_op_catalog_description.pyin the SDK, 13 tests: which ops carry the field, where it sits in the schema, and thatephemeral_argsmatches what the schema offers.tool-direct.test.tsin the runner, 55 tests, including the strip on both dispatch modes and the recorded call keeping the field.toolDisplay.test.tsin the web app covers extraction and truncation.What to QA
This targets
agent-config-editing-s5and is part of the agent-config-editing stack. Read the stack bottom up.Added by the E2E campaign and review fix rounds (5 Aug, evening)