feat(agent): harden loop recovery and permission hook lifecycle
Some checks failed
Release Gate / gate (push) Has been cancelled
Some checks failed
Release Gate / gate (push) Has been cancelled
This commit is contained in:
@@ -1864,6 +1864,42 @@ public class AgentLoopCodeQualityTests
|
||||
delay2.Should().BeLessThan(1850);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsContextOverflowError_DetectsMaxOutputTokenPatterns()
|
||||
{
|
||||
var maxOutput = InvokePrivateStatic<bool>(
|
||||
"IsContextOverflowError",
|
||||
"Request failed: maximum output tokens exceeded");
|
||||
var truncated = InvokePrivateStatic<bool>(
|
||||
"IsContextOverflowError",
|
||||
"response was truncated due to token limit");
|
||||
var unrelated = InvokePrivateStatic<bool>(
|
||||
"IsContextOverflowError",
|
||||
"invalid api key");
|
||||
|
||||
maxOutput.Should().BeTrue();
|
||||
truncated.Should().BeTrue();
|
||||
unrelated.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsLikelyWithheldOrOverflowResponse_DetectsWithheldAndLimitHints()
|
||||
{
|
||||
var withheld = InvokePrivateStatic<bool>(
|
||||
"IsLikelyWithheldOrOverflowResponse",
|
||||
"output withheld because prompt too long");
|
||||
var maxOutput = InvokePrivateStatic<bool>(
|
||||
"IsLikelyWithheldOrOverflowResponse",
|
||||
"max_output_tokens reached");
|
||||
var normal = InvokePrivateStatic<bool>(
|
||||
"IsLikelyWithheldOrOverflowResponse",
|
||||
"completed successfully");
|
||||
|
||||
withheld.Should().BeTrue();
|
||||
maxOutput.Should().BeTrue();
|
||||
normal.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetToolExecutionTimeoutMs_UsesDefaultWhenEnvMissing()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user