Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/mcpx/internal/cli/elicit.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ func (a *App) CmdElicit(ctx context.Context, args []string) error {

switch sub {
case "", "list":
// The daemon's /v1/elicit listing honours elicit.pendingLimit;
// this one read the store with no limit and so always got the
// built-in default, whatever the setting said.
pending, err := b.Pending(elicit.Filter{
Session: *session, Audience: elicit.Audience(*audience),
Limit: a.Settings().Int("elicit.pendingLimit"),
})
if err != nil {
return err
Expand Down
39 changes: 39 additions & 0 deletions pkgs/mcpx/internal/e2e/effect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var implementedEffectProbes = map[string]string{
"protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment",
"protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment",
"events.history": "TestEventsHistoryBoundsTheReplay",
"elicit.pendingLimit": "TestElicitPendingLimitBoundsTheListingFromTheEnvironment",
"elicit.askTimeout": "TestElicitAskTimeoutBoundsTheWaitForAnAnswerFromTheEnvironment",
"artifacts.idleTtl": "TestArtifactsIdleTTLRenewsAReadArtifactFromTheEnvironment",
"artifacts.maxAge": "TestArtifactsMaxAgeCapsARenewedArtifactFromTheEnvironment",
Expand Down Expand Up @@ -276,6 +277,7 @@ var effectProbeFuncs = map[string]func(*testing.T){
"TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment,
"TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment,
"TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay,
"TestElicitPendingLimitBoundsTheListingFromTheEnvironment": TestElicitPendingLimitBoundsTheListingFromTheEnvironment,
"TestElicitAskTimeoutBoundsTheWaitForAnAnswerFromTheEnvironment": TestElicitAskTimeoutBoundsTheWaitForAnAnswerFromTheEnvironment,
"TestArtifactsIdleTTLRenewsAReadArtifactFromTheEnvironment": TestArtifactsIdleTTLRenewsAReadArtifactFromTheEnvironment,
"TestArtifactsMaxAgeCapsARenewedArtifactFromTheEnvironment": TestArtifactsMaxAgeCapsARenewedArtifactFromTheEnvironment,
Expand Down Expand Up @@ -3518,6 +3520,43 @@ func TestElicitAskTimeoutBoundsTheWaitForAnAnswerFromTheEnvironment(t *testing.T
}
}

// TestElicitPendingLimitBoundsTheListingFromTheEnvironment is the effect
// probe for elicit.pendingLimit. Under policy.write=ask, two unannotated
// calls each raise a confirmation that waits up to 5s. While both wait,
// `mcpx elicit list` shows both under the default limit and one under
// elicit.pendingLimit=1.
func TestElicitPendingLimitBoundsTheListingFromTheEnvironment(t *testing.T) {
listed := func(extra ...string) int {
e := newEnv(t, oneServer)
e.setenv(append([]string{"MCPX_POLICY_WRITE=ask", "MCPX_ELICIT_ASK_TIMEOUT=5s"}, extra...)...)
e.run("ls")
beAnswerer(t, e)
done := make(chan struct{}, 2)
for i := 0; i < 2; i++ {
go func() {
_, _ = e.try("call", "demo.structured", `{}`)
done <- struct{}{}
}()
}
time.Sleep(2 * time.Second)
n := len(pendingQuestions(t, e))
for i := 0; i < 2; i++ {
select {
case <-done:
case <-time.After(30 * time.Second):
t.Fatal("a held call never finished")
}
}
return n
}
if n := listed(); n != 2 {
t.Fatalf("oracle: both waiting confirmations should be listed under the default limit, got %d", n)
}
if n := listed("MCPX_ELICIT_PENDING_LIMIT=1"); n != 1 {
t.Fatalf("with elicit.pendingLimit=1 the listing should hold one question, got %d", n)
}
}

// TestDaemonAddressIsReachableFromTheEnvironment is the effect probe
// for daemon.address (#8468 chain 1). The exemption it replaced said
// a bind address is a network identity the harness cannot vary
Expand Down
1 change: 0 additions & 1 deletion pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ setting paths.config no integration-test exercise yet; burn-down #8467 (settings
setting elicit.disambiguate no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting elicit.disambiguateDefault no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting elicit.maxAge no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting elicit.pendingLimit no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting elicit.ttl no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting embeddings.apiKey no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting embeddings.backend no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
Expand Down
Loading