Add createdAt for chat.Message - #3
Closed
dgageot wants to merge 3 commits into
Closed
Conversation
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>
Member
Author
|
Merged with 6df068d |
a-dubs
pushed a commit
to a-dubs/cagent
that referenced
this pull request
Sep 3, 2025
Fix overflow dialog.
a-dubs
pushed a commit
to a-dubs/cagent
that referenced
this pull request
Sep 3, 2025
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
This was referenced Apr 30, 2026
Merged
aheritier
added a commit
that referenced
this pull request
Aug 27, 2026
…rt, align bounds Addresses all blocking and should-fix findings from the aheritier review on PR #4062: [blocking #1 + #2] Generic classifier with HTTP-status precedence: - Add modelerrors.RetryableHTTPStatus(err) — catches any error carrying a retryable HTTP status (429/408/5xx) via *StatusError or message regex, without string-pattern heuristics ('connection refused' stays non-retryable). - startBackoffRetryable becomes: return err != nil && RetryableHTTPStatus(err). A StatusError{429} coexisting with context.DeadlineExceeded now arms the gate (HTTP wins), fixing the deadline-masks-rate-limit race. [blocking #3] Bounds aligned with remediation plan: - base = 15s, cap = 5min (was 1s/30s). - Additive jitter [d, 1.2d] (was equal jitter [d/2, d]), guaranteeing the full nominal wait is always respected. [blocking #4] Gate enforced only in the TryStart path: - Move gate check from startLocked into new tryStartLocked (called by TryStart/TryStartWithTimeout only). - Start() calls startLocked directly — mcpcatalog enable and skill sub-session startup are never delayed. [should-fix #5] External recovery via StartReporter: - tryStartLocked checks reporter.IsStarted() when started==false; a live reporter (e.g. after /toolset-restart) clears the gate and latches the wrapper without calling the underlying Start. - New test: TestStartableToolSet_ExternalRecoveryClearsBackoffGate. [should-fix #6] Exported constructor options for cross-package tests: - NewStartable(ts, opts...) with StartableOption, WithStartRetryJitter, WithStartRetryClock. - nowFn() clock seam; zero-value StartableToolSet still usable. [should-fix #7] Concurrent and at-boundary tests: - TestStartableToolSet_BackoffNoDoubleStartWithinWindow: 20 goroutines calling TryStart, assert underlying Start invoked exactly once. - TestStartableToolSet_BackoffAtBoundary: fake clock, gate open at expiry. [optional] Stale comment name in BackoffDormantForPlainErrors fixed. Also: - RetryableHTTPStatus test cases include plain-text regex fallback. - ExportedSetClock removed (unused; WithStartRetryClock preferred). - All gating tests converted from s.Start() to s.TryStart(). - Jitter-bounds assertions updated to [nominal, 1.2×nominal]. PR2 (#4065) will need rebasing and test updates after this lands.
aheritier
added a commit
that referenced
this pull request
Aug 27, 2026
…rt, align bounds Addresses all blocking and should-fix findings from the aheritier review on PR #4062: [blocking #1 + #2] Generic classifier with HTTP-status precedence: - Add modelerrors.RetryableHTTPStatus(err) — catches any error carrying a retryable HTTP status (429/408/5xx) via *StatusError or message regex, without string-pattern heuristics ('connection refused' stays non-retryable). - startBackoffRetryable becomes: return err != nil && RetryableHTTPStatus(err). A StatusError{429} coexisting with context.DeadlineExceeded now arms the gate (HTTP wins), fixing the deadline-masks-rate-limit race. [blocking #3] Bounds aligned with remediation plan: - base = 15s, cap = 5min (was 1s/30s). - Additive jitter [d, 1.2d] (was equal jitter [d/2, d]), guaranteeing the full nominal wait is always respected. [blocking #4] Gate enforced only in the TryStart path: - Move gate check from startLocked into new tryStartLocked (called by TryStart/TryStartWithTimeout only). - Start() calls startLocked directly — mcpcatalog enable and skill sub-session startup are never delayed. [should-fix #5] External recovery via StartReporter: - tryStartLocked checks reporter.IsStarted() when started==false; a live reporter (e.g. after /toolset-restart) clears the gate and latches the wrapper without calling the underlying Start. - New test: TestStartableToolSet_ExternalRecoveryClearsBackoffGate. [should-fix #6] Exported constructor options for cross-package tests: - NewStartable(ts, opts...) with StartableOption, WithStartRetryJitter, WithStartRetryClock. - nowFn() clock seam; zero-value StartableToolSet still usable. [should-fix #7] Concurrent and at-boundary tests: - TestStartableToolSet_BackoffNoDoubleStartWithinWindow: 20 goroutines calling TryStart, assert underlying Start invoked exactly once. - TestStartableToolSet_BackoffAtBoundary: fake clock, gate open at expiry. [optional] Stale comment name in BackoffDormantForPlainErrors fixed. Also: - RetryableHTTPStatus test cases include plain-text regex fallback. - ExportedSetClock removed (unused; WithStartRetryClock preferred). - All gating tests converted from s.Start() to s.TryStart(). - Jitter-bounds assertions updated to [nominal, 1.2×nominal]. PR2 (#4065) will need rebasing and test updates after this lands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.