[agent/codex:gpt-5.3-codex-spark] Read docs/RFC.md fully. Find ONE feature described in the sp... #84

Merged
Virgil merged 1 commit from main into dev 2026-04-03 23:05:26 +00:00
3 changed files with 26 additions and 3 deletions

View file

@ -289,7 +289,7 @@ func (service *Service) handleServe(ctx context.Context, values map[string]any)
return nil, false, err
}
if !portProvided {
port = service.dnsPort
port = service.resolveServePort()
}
result, err := service.Serve(bind, port)
if err != nil {
@ -298,6 +298,13 @@ func (service *Service) handleServe(ctx context.Context, values map[string]any)
return result, true, nil
}
func (service *Service) resolveServePort() int {
if service == nil || service.dnsPort <= 0 {
return DefaultDNSPort
}
return service.dnsPort
}
func stringActionValue(values map[string]any, key string) (string, error) {
if values == nil {
return "", errActionMissingValue

View file

@ -18,6 +18,7 @@ import (
// service := dns.NewService(dns.ServiceOptions{})
// fmt.Println(dns.DefaultTreeRootCheckInterval)
const DefaultTreeRootCheckInterval = 15 * time.Second
const DefaultDNSPort = 53
// NameRecords stores the cached DNS records for one name.
//

View file

@ -2233,6 +2233,21 @@ func TestServiceHandleActionServeDefaultsPortFromServiceConfiguration(t *testing
_ = dnsServer.Close()
}
func TestServiceResolveServePortDefaultsToStandardDNSPort(t *testing.T) {
service := NewService(ServiceOptions{})
if service.resolveServePort() != DefaultDNSPort {
t.Fatalf("expected serve to default to standard DNS port %d, got %d", DefaultDNSPort, service.resolveServePort())
}
customPort := 1053
customService := NewService(ServiceOptions{
DNSPort: customPort,
})
if customService.resolveServePort() != customPort {
t.Fatalf("expected resolveServePort to honor configured DNSPort, got %d", customService.resolveServePort())
}
}
func TestServiceActionNamesExposeAllRFCActions(t *testing.T) {
service := NewService(ServiceOptions{})
@ -2636,8 +2651,8 @@ func TestServiceDiscoverAliasesFallsBackToMainchainAliasRPCUsingHSDURL(t *testin
defer server.Close()
service := NewService(ServiceOptions{
HSDURL: server.URL,
Records: map[string]NameRecords{},
HSDURL: server.URL,
Records: map[string]NameRecords{},
})
if err := service.DiscoverAliases(context.Background()); err != nil {