Adds hybrid_cloud_rpc skill to claude config#108548
Adds hybrid_cloud_rpc skill to claude config#108548GabeVillalobos wants to merge 4 commits intomasterfrom
Conversation
| ### When to use `repr=False` | ||
|
|
||
| | Field type | Examples | Why hide it | | ||
| | --------------------------- | -------------------------------------------------- | --------------------------------------------- | | ||
| | **Secrets & credentials** | tokens, hashed passwords, API keys, client secrets | Prevents leaking secrets into logs | | ||
| | **Opaque blobs** | `config`, `metadata`, `extra_data` dicts | Noisy in logs, may contain PII or credentials | | ||
| | **Session/auth material** | session nonces, OAuth tokens | Security-sensitive | | ||
| | **Request/response bodies** | headers, payloads | May contain auth headers or PII | |
There was a problem hiding this comment.
This was a manual addition. Adding this to sensitive fields should now be the norm.
| class Config: | ||
| orm_mode = True | ||
| use_enum_values = True |
There was a problem hiding this comment.
I don't think it should be standard practice to include a config in every RPCModel, so I do wonder if we actually need this portion. If we do, maybe we need another decision tree to guide a user through setting these whenever appropriate.
| ### 7.1 Silo mode compatibility with `@all_silo_test` | ||
|
|
There was a problem hiding this comment.
This was an opinionated piece I added to cover comprehensive testing, at minimum at the service level. It's something we didn't historically do, but I've found it more helpful than not.
| Test that any calling code (both direct and indirect) is also appropriately | ||
| tested with the correct silo decorators. | ||
|
|
There was a problem hiding this comment.
This was the second manually added chunk that finally got the code generation to respect error propagation.
| ### Error propagation | ||
|
|
||
| All errors an RPC method propagates must be done via the return type. Errors are | ||
| rewrapped and returned as generic Invalid service request to external callers. | ||
|
|
||
| ```python | ||
| class RpcTentativeResult(RpcModel): | ||
| success: bool | ||
| error_str: str | None | ||
| result: str | None | ||
|
|
||
| class DatabaseBackedMyuService(MyService): | ||
| def foobar(self, *, organization_id: int) -> RpcTentativeResult | ||
| try: | ||
| some_function_call() | ||
| except e: | ||
| return RpcTentativeResult(success=False, error_str = str(e)) | ||
|
|
||
| return RpcTentativeResult(success=True, result="foobar") | ||
| ``` |
There was a problem hiding this comment.
This was all manual, and mostly an opinionated take on how error handling at the RPC level should be done.
Adds skills to handle creation, modification, and deprecation of Hybrid Cloud RPC services. It includes background for:
As configured, the skills will guide a developer through most of these processes with granular prompts, and does a reasonable job implementing a coarse first pass. To see an example, check the stubs generated here: #108571