Skip to content

Add createdAt for chat.Message#3

Closed
dgageot wants to merge 3 commits intomainfrom
add-createdAt-chat-message
Closed

Add createdAt for chat.Message#3
dgageot wants to merge 3 commits intomainfrom
add-createdAt-chat-message

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Sep 1, 2025

No description provided.

Signed-off-by: Trung Nguyen <trungutt@users.noreply.github.com>
Signed-off-by: Trung Nguyen <trungutt@users.noreply.github.com>
Signed-off-by: Trung Nguyen <trungutt@users.noreply.github.com>
@dgageot
Copy link
Copy Markdown
Member Author

dgageot commented Sep 2, 2025

Merged with 6df068d

@dgageot dgageot closed this Sep 2, 2025
a-dubs pushed a commit to a-dubs/cagent that referenced this pull request Sep 3, 2025
a-dubs pushed a commit to a-dubs/cagent that referenced this pull request Sep 3, 2025
@rumpl rumpl deleted the add-createdAt-chat-message branch September 16, 2025 18:31
dgageot added a commit to dgageot/cagent that referenced this pull request Apr 15, 2026
This is useful for computing baselines by running the same eval(s) N times.
Each repeated eval gets a '#N' suffix in its title (e.g. 'my-eval docker#3').

Assisted-By: docker-agent
dgageot added a commit that referenced this pull request Apr 28, 2026
…nctionCall scrub

Five fixes from a self-review pass:

1. Bug: pre_tool_use builtin returned the entire ToolInput map in

   UpdatedInput. Hooks for one event run concurrently and aggregate

   via shallow maps.Copy in config order, so emitting unchanged keys

   would clobber a sibling hook's modifications. Fix: only emit keys

   whose value actually changed (new redactToolInput helper). This

   also removes the unsafe top-level type assertion on redactAny's

   any-typed return value.

2. Security gap: the runtime transform missed two text-bearing

   surfaces that round-trip to providers:

     - chat.Message.ReasoningContent (sent back to Anthropic, Bedrock,

       and DeepSeek as a thinking block)

     - the legacy singular chat.Message.FunctionCall.Arguments

       (still emitted by the OpenAI provider when set)

   A secret in either of those fields would round-trip to the next

   LLM call. Now both are scrubbed; the FunctionCall pointer is

   deep-copied so the caller's history stays untouched.

3. Performance: secretsscan.Redact called strings.ToLower(out) and

   compiledRules() once per rule (~85 iterations), which on long

   inputs dominated the work. Hoisted both out of the loop. Sound

   because RedactionMarker contains no rule keyword (locked in by

   the new TestRedactionMarkerIsNotASecret) so a stale lower-case

   only ever produces extra-cautious regex runs, not false negatives.

   Allocations on a 9KB clean message: ~85 -> 2.

4. Test gap: added TestRedactionMarkerIsNotASecret to lock in the

   safety property the idempotence claim relies on (the marker must

   not match any rule, even when surrounded by arbitrary text).

5. Added BenchmarkRedactCleanInput / BenchmarkRedactWithSecret as a

   regression guard for #3.

Tests + lint: green. Behavior on clean inputs and previously-tested

secrets is unchanged.

Assisted-By: docker-agent
@docker-agent docker-agent Bot mentioned this pull request May 6, 2026
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.

2 participants