Skip to content

feat(claude-sdk): expose owned prompt text - #884

Open
yordis wants to merge 4 commits into
yordis/feat-claude-sdk-disallowed-toolsfrom
yordis/feat-claude-sdk-prompt
Open

yordis wants to merge 4 commits into
yordis/feat-claude-sdk-disallowed-toolsfrom
yordis/feat-claude-sdk-prompt

Conversation

@yordis

@yordis yordis commented Nov 9, 2026 •

Copy link
Copy Markdown
Member
  • Keep prompt input distinct in the Rust API while preserving upstream string values.

Note

Low Risk
Adds a new public type and docs/tests only; no runtime, auth, or client behavior changes.

Overview
Introduces a Prompt newtype in the Claude Agent SDK crate so query text is a distinct Rust API type while mirroring upstream query(prompt=...) strings without validation or wire dispatch.

The type wraps owned String with infallible From conversions for &str and String, plus as_str, Display, and standard derives. README gains a "Typed input values" section documenting Prompt against Python/TypeScript; BUILD.bazel registers a prompt integration test target; tests assert preservation of multiline/unicode/whitespace and JSON round-trip behavior for empty and NUL-containing strings.

Reviewed by Cursor Bugbot for commit b2825e6. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f7ab549-2f3d-42c8-b648-bf87eae61171
Commits

Reviewing files that changed from the base of the PR and between b4342b9 and b2825e6.

Files selected for processing: 5

  • rsworkspace/crates/platform/trogon-claude-agent-sdk/BUILD.bazel
  • rsworkspace/crates/platform/trogon-claude-agent-sdk/README.md
  • rsworkspace/crates/platform/trogon-claude-agent-sdk/src/lib.rs
  • rsworkspace/crates/platform/trogon-claude-agent-sdk/src/prompt.rs
  • rsworkspace/crates/platform/trogon-claude-agent-sdk/tests/prompt.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@yordis
yordis added this pull request to stack #908 November 9, 2026 03:18
@yordis
yordis force-pushed the yordis/feat-claude-sdk-prompt branch from 8383e9d to 70e145b Compare November 9, 2026 03:46
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🧪 Test coverage: 98.59860275%

Code Coverage Summary

Details
Filename                                                                                                        Stmts    Miss  Cover    Missing
------------------------------------------------------------------------------------------------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------------------------------------------------------
rsworkspace/crates/platform/trogon-nats/src/messaging.rs                                                          168       2  98.81%   146, 156
rsworkspace/crates/mcp/mcp-nats/src/nats/parsing.rs                                                                54       1  98.15%   13
rsworkspace/crates/platform/trogon-std/src/signal.rs                                                               22       9  59.09%   6-11, 20-22
rsworkspace/crates/platform/trogon-std/src/args.rs                                                                 12       9  25.00%   11-28
rsworkspace/crates/a2a/a2a-nats-stdio/src/dispatch.rs                                                             186       8  95.70%   114, 117-119, 217, 220-222
rsworkspace/crates/a2a/a2a-nats/src/push/dlq_dedup.rs                                                              51       1  98.04%   79
rsworkspace/crates/decider/trogon-decider-runtime/src/authorization.rs                                            155       9  94.19%   424-426, 438-440, 461-463
rsworkspace/crates/decider/trogon-decider-runtime/src/memory.rs                                                   109      10  90.83%   77-82, 181-186
rsworkspace/crates/decider/trogon-decider-runtime/src/replay_bounds.rs                                             55       6  89.09%   25-32
rsworkspace/crates/decider/trogon-decider-runtime/src/admission.rs                                                 62      12  80.65%   56-64, 150-152, 206-208
rsworkspace/crates/decider/trogon-decider-runtime/src/execution.rs                                                807       5  99.38%   249-250, 370, 853, 1811
rsworkspace/crates/mcp/mcp-nats-server/src/runtime.rs                                                             565      20  96.46%   195, 304, 503-508, 513, 520, 527, 539, 582, 612, 695, 727, 771-776
rsworkspace/crates/a2a/a2a-nats/src/catalog/import_gate/spicedb/client.rs                                          29      15  48.28%   43-69, 97-99, 108-117
rsworkspace/crates/platform/trogon-gateway/src/source/discord/gateway.rs                                          120       1  99.17%   139
rsworkspace/crates/a2a/a2a-nats-http/src/sse.rs                                                                    30      14  53.33%   17-35, 45-46, 49-52
rsworkspace/crates/a2a/a2a-nats-http/src/router.rs                                                                 55      13  76.36%   60-63, 69-79
rsworkspace/crates/a2a/a2a-nats-http/src/headers.rs                                                               126       1  99.21%   152
rsworkspace/crates/a2a/a2a-nats-http/src/rest.rs                                                                  304       2  99.34%   120-121
rsworkspace/crates/a2a/a2a-bridge/src/inbound.rs                                                                  443      15  96.61%   140-142, 384-388, 433-438, 458, 461-462, 465-471, 724
rsworkspace/crates/a2a/a2a-bridge/src/auth.rs                                                                      64       3  95.31%   101-102, 170
rsworkspace/crates/a2a/a2a-bridge/src/outbound.rs                                                                  70       7  90.00%   126, 197-209
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier2_cel/compiler.rs                                                25       3  88.00%   61-63
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier2_cel/bundle.rs                                                 120      25  79.17%   70-72, 74-76, 86, 92, 111-113, 123-127, 162-164, 166-168, 171, 178, 181
rsworkspace/crates/a2a/a2a-redaction/src/wasm/mod.rs                                                              110       9  91.82%   132-134, 147-149, 162-164
rsworkspace/crates/a2a/a2a-redaction/src/wasm/engine.rs                                                            62      11  82.26%   29-31, 63-64, 76-78, 82-84
rsworkspace/crates/acp/acp-nats-stdio/src/main.rs                                                                  50       7  86.00%   90-97, 109
rsworkspace/crates/a2a/a2a-bridge/src/auth/callout_mint.rs                                                         66       1  98.48%   92
rsworkspace/crates/platform/jsonrpc-nats/src/codec/canonical.rs                                                   194      20  89.69%   132, 200-204, 228-230, 241, 248, 265-266, 273, 277-284
rsworkspace/crates/platform/jsonrpc-nats/src/codec/reconstruct.rs                                                  90       4  95.56%   56-59
rsworkspace/crates/scheduler/trogon-scheduler/src/commands/record_schedule_occurrence.rs                          113       1  99.12%   183
rsworkspace/crates/ard/ard-nats/src/catalog_index.rs                                                               82       2  97.56%   37, 104
rsworkspace/crates/ard/ard-nats/src/catalog_subject.rs                                                             14       3  78.57%   16-18
rsworkspace/crates/a2a/a2a-nats/src/gateway_ingress.rs                                                             98       1  98.98%   47
rsworkspace/crates/a2a/a2a-nats/src/wire.rs                                                                        53       2  96.23%   79, 94
rsworkspace/crates/decider/trogon-decider-nats-server/src/event_subject.rs                                         39       3  92.31%   56-58
rsworkspace/crates/decider/trogon-decider-nats-server/src/runtime.rs                                              236      29  87.71%   142-144, 229-231, 240-244, 269-278, 296-298, 303, 315-316, 345-346, 368
rsworkspace/crates/decider/trogon-decider-nats-server/src/module_source.rs                                         90      20  77.78%   128-137, 154-157, 162-164, 189-191
rsworkspace/crates/decider/trogon-decider-nats-server/src/outcome.rs                                               99       2  97.98%   121, 129
rsworkspace/crates/decider/trogon-decider-runtime/src/stream/append_stream.rs                                       9       4  55.56%   90-93
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/checkpoints/codec.rs                        318      17  94.65%   340-341, 361-362, 373-377, 405-406, 412-413, 442-443, 480, 485-487
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/checkpoints/store.rs                        142      12  91.55%   221-227, 276-280
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/reconciliation/reconcile.rs                 303      13  95.71%   244-253, 318-320
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/reconciliation/recorded_events.rs           238      12  94.96%   196-201, 238, 246, 267, 287, 293, 299, 332, 342, 360, 444
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/reconciliation/request.rs                   221       2  99.10%   255, 260
rsworkspace/crates/platform/trogon-gateway/src/source/linear/signature.rs                                           8       1  87.50%   16
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier1_declarative/evaluator.rs                                      154       3  98.05%   184-185, 282
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier1_declarative/loader.rs                                          87       9  89.66%   101-103, 105-107, 132-134
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier1_declarative/time_predicate.rs                                 118       2  98.31%   103, 125
rsworkspace/crates/a2a/a2a-redaction/src/signed_bundle/public_key.rs                                               36       2  94.44%   44-45
rsworkspace/crates/a2a/a2a-redaction/src/signed_bundle/verify.rs                                                   64       2  96.88%   85-86
rsworkspace/crates/a2a/a2a-redaction/src/signed_bundle/manifest.rs                                                 56       1  98.21%   82
rsworkspace/crates/a2a/a2a-redaction/src/signed_bundle/signature.rs                                                30       3  90.00%   37-39
rsworkspace/crates/a2a/a2a-gateway/src/runtime/policy_stack.rs                                                    105       3  97.14%   170-172
rsworkspace/crates/a2a/a2a-gateway/src/runtime/tier1_denial.rs                                                     37       1  97.30%   64
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/wakeup.rs                                    99       1  98.99%   128
rsworkspace/crates/decider/trogon-decider-wasm-runtime/src/execution.rs                                           969      44  95.46%   142, 683, 685, 766, 1066, 1080-1082, 1096, 1109, 1113, 1166, 1227, 1274-1278, 1326-1330, 1369-1373, 1432, 1437-1441, 1513-1517, 1559-1561, 1631, 1652
rsworkspace/crates/decider/trogon-decider-wasm-runtime/src/test_doubles.rs                                         73       5  93.15%   64, 85-87, 90
rsworkspace/crates/decider/trogon-decider-wasm-runtime/src/command_spec.rs                                         32       1  96.88%   57
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/worker/dispatcher.rs                        281       1  99.64%   202
rsworkspace/crates/scheduler/trogon-scheduler/src/processor/execution/worker/processor.rs                         318      10  96.86%   442-443, 449, 519-521, 553-556
rsworkspace/crates/platform/jsonrpc-nats/src/id.rs                                                                 68      12  82.35%   73-74, 97-98, 100-101, 114-115, 117-119, 128
rsworkspace/crates/platform/jsonrpc-nats/src/message.rs                                                            11       3  72.73%   37-39
rsworkspace/crates/platform/jsonrpc-nats/src/transport.rs                                                         102       4  96.08%   26, 30-31, 121
rsworkspace/crates/platform/trogon-nats/src/jetstream/processor.rs                                                109      12  88.99%   85-88, 220, 268-270, 277, 280-282
rsworkspace/crates/platform/trogon-nats/src/jetstream/claim_check.rs                                              148       3  97.97%   45-47
rsworkspace/crates/platform/trogon-nats/src/jetstream/mocks.rs                                                    974       1  99.90%   564
rsworkspace/crates/ard/ard-catalog/src/trust_manifest.rs                                                           45       1  97.78%   35
rsworkspace/crates/ard/ard-catalog/src/catalog_manifest_schema.rs                                                  65       4  93.85%   105-106, 108-109
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/prompt.rs                                                  12       3  75.00%   11-13
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/tool_rule.rs                                               12       3  75.00%   11-13
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/agent_name.rs                                               9       3  66.67%   11-13
rsworkspace/crates/a2a/a2a-auth-callout/src/credentials/api_key.rs                                                 49       1  97.96%   36
rsworkspace/crates/a2a/a2a-auth-callout/src/credentials/mtls.rs                                                   207       8  96.14%   274-277, 280-283
rsworkspace/crates/platform/trogon-nats/src/lease/provision.rs                                                     83      10  87.95%   76-86
rsworkspace/crates/platform/trogon-nats/src/lease/release.rs                                                        5       5  0.00%    8-12
rsworkspace/crates/platform/trogon-nats/src/lease/acquire.rs                                                        5       5  0.00%    9-14
rsworkspace/crates/platform/trogon-nats/src/lease/mod.rs                                                          107      13  87.85%   111-124
rsworkspace/crates/platform/trogon-nats/src/lease/renew.rs                                                         82      19  76.83%   21-27, 46-57
rsworkspace/crates/platform/trogon-telemetry/src/lib.rs                                                           126      20  84.13%   125, 130, 135, 145-146, 152-166, 200, 203, 206, 212
rsworkspace/crates/platform/trogon-telemetry/src/trace.rs                                                          15       1  93.33%   24
rsworkspace/crates/platform/trogon-telemetry/src/service_name.rs                                                   21       1  95.24%   40
rsworkspace/crates/platform/trogon-telemetry/src/metric.rs                                                         18       1  94.44%   30
rsworkspace/crates/scheduler/trogon-scheduler/src/error.rs                                                         85       3  96.47%   131-133
rsworkspace/crates/scheduler/trogon-scheduler/src/mocks.rs                                                        413      25  93.95%   80, 272, 289-292, 334-336, 350-354, 363, 416-420, 475-476, 480, 519-522
rsworkspace/crates/decider/trogon-decider-sim/src/import_check.rs                                                  52       4  92.31%   81-83, 103
rsworkspace/crates/decider/trogon-decider-sim/src/parity.rs                                                        66       6  90.91%   91-93, 95-97
rsworkspace/crates/decider/trogon-decider-sim/src/session.rs                                                       23       4  82.61%   47-55
rsworkspace/crates/decider/trogon-decider-sim/src/native.rs                                                        81       2  97.53%   196, 214
rsworkspace/crates/decider/trogon-decider-sim/src/scenario.rs                                                     205       1  99.51%   579
rsworkspace/crates/decider/trogon-decider-sim/src/fixture.rs                                                       18       2  88.89%   33-35
rsworkspace/crates/decider/trogon-decider-sim/src/ir.rs                                                           120       5  95.83%   114, 117, 121, 277, 319
rsworkspace/crates/platform/trogon-gateway/src/source_integration_id.rs                                            28       2  92.86%   58, 60
rsworkspace/cli/trogon-decider-publish/src/main.rs                                                                 18      18  0.00%    62-81
rsworkspace/crates/scheduler/trogon-scheduler-domain/src/commands/domain/schedule.rs                              383       5  98.69%   327, 335, 350-352
rsworkspace/crates/a2a/a2a-nats/src/server/wire.rs                                                                 39       4  89.74%   20-22, 29
rsworkspace/crates/a2a/a2a-nats/src/server/message_stream.rs                                                       62       6  90.32%   179-181, 189-191
rsworkspace/crates/a2a/a2a-nats/src/server/test_support.rs                                                         81      25  69.14%   134-159
rsworkspace/crates/a2a/a2a-auth-callout/src/signing_key_source/file.rs                                             37       3  91.89%   31-33
rsworkspace/crates/mcp/mcp-nats/src/transport.rs                                                                  190       6  96.84%   246, 258-260, 313-314
rsworkspace/crates/mcp/mcp-nats/src/wire.rs                                                                        40       1  97.50%   49
rsworkspace/crates/decider/trogon-decider-wit/src/lib.rs                                                           53       1  98.11%   35
rsworkspace/crates/acp/acp-nats-agent/src/connection.rs                                                           501       1  99.80%   754
rsworkspace/crates/acp/acp-nats/src/agent/prompt.rs                                                               113       7  93.81%   154-160
rsworkspace/crates/acp/acp-nats/src/agent/js_request.rs                                                            79       6  92.41%   91-96
rsworkspace/crates/a2a/a2a-nats-http/src/handlers/mod.rs                                                          169      12  92.90%   67, 82, 85-86, 116, 150, 160, 163-164, 177, 251-253
rsworkspace/crates/a2a/a2a-auth-callout/src/jwt/nats_user_jwt.rs                                                  197       1  99.49%   136
rsworkspace/crates/a2a/a2a-gateway/src/policy/spicedb_tier1.rs                                                    102      10  90.20%   233, 279, 281-289
rsworkspace/crates/aauth/trogon-aauth-verify/src/token.rs                                                         255       1  99.61%   236
rsworkspace/crates/acp/acp-nats/src/client/mod.rs                                                                 105       1  99.05%   58
rsworkspace/crates/acp/acp-nats/src/client/rpc_reply.rs                                                           107      24  77.57%   61-63, 97-120
rsworkspace/crates/acp/acp-nats/src/client_proxy.rs                                                                67       1  98.51%   57
rsworkspace/crates/acp/acp-nats/src/wire.rs                                                                        86       1  98.84%   112
rsworkspace/crates/a2a/a2a-auth-callout/src/subscriber.rs                                                         120      15  87.50%   25-31, 89, 91, 112, 149-155
rsworkspace/crates/scheduler/trogon-scheduler-domain/src/commands/proto_wire.rs                                   138       1  99.28%   231
rsworkspace/crates/scheduler/trogon-scheduler/src/commands/domain/recurrence.rs                                    78       1  98.72%   99
rsworkspace/crates/decider/trogon-decider-guest-macros/src/lib.rs                                                 117      20  82.91%   14-19, 29-40, 423, 427
rsworkspace/crates/ard/ard-registry/src/registry.rs                                                               134       3  97.76%   78, 174, 183
rsworkspace/crates/ard/ard-registry/src/source_url.rs                                                              26       1  96.15%   30
rsworkspace/crates/ard/ard-registry/src/lexical_rank.rs                                                            55       2  96.36%   15, 64
rsworkspace/crates/ard/ard-registry/src/search_request.rs                                                          32       1  96.88%   43
rsworkspace/crates/decider/trogon-decider-nats/src/stream_store.rs                                                310      12  96.13%   66-68, 388, 417, 420, 436-440, 584-585, 643
rsworkspace/crates/decider/trogon-decider-nats/src/provision.rs                                                   122      21  82.79%   261, 266-274, 294, 299-310
rsworkspace/crates/decider/trogon-decider-nats/src/store.rs                                                       236      16  93.22%   204-211, 260-263, 374, 383-388
rsworkspace/crates/decider/trogon-decider-nats/src/retention.rs                                                   132      19  85.61%   81-83, 300-321
rsworkspace/crates/acp/acp-nats/src/nats/jsonrpc.rs                                                                51      11  78.43%   46, 54-55, 57-63, 81-83
rsworkspace/crates/acp/acp-nats/src/nats/mod.rs                                                                    61      13  78.69%   24-35, 77
rsworkspace/crates/a2a/a2a-gateway/src/gw_pull_backpressure.rs                                                    401       3  99.25%   529-531
rsworkspace/crates/a2a/a2a-gateway/src/push_dlq_mirror.rs                                                         176      15  91.48%   264, 277-278, 288-294, 313-317, 336-337, 345-346
rsworkspace/crates/decider/trogon-decider-nats/src/stream_store/replay.rs                                         141      10  92.91%   114, 143, 165, 228-236
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier3_redaction/json_path.rs                                         84       5  94.05%   37, 49, 85, 104, 115
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier3_redaction/mod.rs                                               33       1  96.97%   57
rsworkspace/crates/a2a/a2a-gateway/src/policy/tier3_redaction/real_gate.rs                                        138      30  78.26%   18-20, 42-44, 67, 76-80, 119, 148-152, 155-159, 170-174, 192, 265
rsworkspace/crates/a2a/a2a-redaction/src/skill_manifest.rs                                                        310      14  95.48%   139, 169-171, 177, 184-188, 358-360, 452
rsworkspace/crates/a2a/a2a-auth-callout/src/wire/server_auth_request_claims.rs                                    120       3  97.50%   51-53
rsworkspace/crates/a2a/a2a-auth-callout/src/wire/callout_auth_response_claims.rs                                   58       3  94.83%   81-83
rsworkspace/crates/a2a/a2a-nats/src/catalog/spicedb_permission.rs                                                 143      17  88.11%   149-154, 173, 338-342, 371-372, 383-385, 392-394
TOTAL                                                                                                           72285    1013  98.60%

Diff against main

Filename                                                                 Stmts    Miss  Cover     Missing
---------------------------------------------------------------------  -------  ------  --------  ----------
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/options.rs         +12       0  +100.00%
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/prompt.rs          +12      +3  +75.00%   11, 12, 13
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/tool_rule.rs       +12      +3  +75.00%   11, 12, 13
rsworkspace/crates/platform/trogon-claude-agent-sdk/src/agent_name.rs       +9      +3  +66.67%   11, 12, 13
TOTAL                                                                      +45      +9  -0.01%

Results for commit: 1d1fc81

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

@yordis
yordis force-pushed the yordis/feat-claude-sdk-prompt branch from 70e145b to 94d0a8e Compare November 9, 2026 07:42
@yordis yordis changed the title feat(claude-sdk): expose validated prompt text feat(claude-sdk): expose owned prompt text Nov 9, 2026
@yordis
yordis force-pushed the yordis/feat-claude-sdk-prompt branch 2 times, most recently from 0636f2e to ea627e7 Compare November 12, 2026 04:05
@yordis
yordis force-pushed the yordis/feat-claude-sdk-prompt branch 2 times, most recently from 3269e76 to dc43991 Compare November 12, 2026 05:46
@yordis
yordis marked this pull request as ready for review November 12, 2026 06:18
@yordis
yordis force-pushed the yordis/feat-claude-sdk-prompt branch 3 times, most recently from e63c5e6 to 65b90c3 Compare November 12, 2026 07:49
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Bazel only creates test targets for files listed in integration_tests, so unlisted tests never run in the Bazel CI job.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/feat-claude-sdk-prompt branch from 65b90c3 to b2825e6 Compare November 12, 2026 08:05

This branch has not been deployed

No deployments
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