Repository navigation
Resolve short names on the caller's domain with FMSG_DEFAULT_DOMAIN=caller - #11
Merged
Merged
Conversation
…aller A server serving callers on several domains cannot use one fixed default domain. The reserved value `caller` (case-insensitive) resolves short names on the domain of the address the server acts as for each request: the per-request caller over HTTP (API key or OAuth) and the configured key's address over stdio. whoami's default_domain and the server instructions show that domain when known. Directory entries still take precedence; a fixed or unset default domain behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
A server that serves callers on several domains can't use one server-wide
FMSG_DEFAULT_DOMAIN. This adds a reserved value,FMSG_DEFAULT_DOMAIN=caller(case-insensitive). With it, short names resolve on the domain of the address the server acts as for each request. For example,bobbecomes@bob@example.orgfor@mark@example.organd@bob@example.netfor a caller onexample.net.send_message,reply,add_recipientsandwait_for_message(from) already resolve the caller first. Incallermode,resolve_addressnow does the same, which can trigger the token exchange. It resolves locally in every other mode, as before.default_domainand the line "Short names resolve to @name@." show the caller's domain.FMSG_DEFAULT_DOMAINbehaves as before, and theresolutionvalue staysdefault_domain.Implementation:
CALLER_DOMAINandeffectiveDefaultDomain()insrc/address.ts.AddressResolvergains an optionalcallerAddress, andresolverFor(deps, caller)insrc/tools/common.tsbuilds the per-caller resolver.Docs: README env table,
--help,docs/http-deployment.mdand CHANGELOG (Unreleased).Tests
New
test/default-domain.test.tscovers:caller,CALLERand@Caller, plus real and empty valuesresolveAddresswith a caller domain, directory precedence, a missing caller address, and a fixed or unset domainwhoami,resolve_address,send_messageand instructions use its own domainnpm run typecheckandnpm testpass (165 tests).🤖 Generated with Claude Code