Skip to content

self.commit fails because its conversation is missing #35

Description

@oreodave

Yo yo yo, back at it again with another issue, again on self.commit.

Got the clanker to generate a summary again, but I believe I've fixed
the issue - raised a correlated PR regarding it (which you can find
#36).

Basically it seems the auth tests are using the current application
instance instead of making up a one for the test. This causes the
test to fail and, in turn, self.commit to fail.

While my PR does fix the issue in one specific test, I think the
suggestion to harden the overall ASDF suite to use a disposable worker
is a nice idea - more below.

Summary

self.commit cannot publish a tested active-image mutation. Two
identical self.commit attempts failed with Conversation 52X6kxF does not exist. The mutation remains installed and effective but
pending, so the private image commit is not created or selected.

Environment

  • Autolith repository: /home/oreo/.local/src/autolith
  • Commit: 775f7de Keep non-error conditions from killing the image
  • OS: Linux 7.1.8-arch1-3, x86-64
  • SBCL: 2.6.6
  • Autolith private image before the attempt: base, synchronized, no
    pending mutations

Steps to reproduce

  1. Start from a synchronized base private image.

  2. Define a function through self.redefine, for example:

    (defun string-whitespace-p (string)
      "Return T when STRING contains only Common Lisp whitespace characters."
      (every (lambda (character)
               (member character '(#\Space #\Tab #\Newline #\Return #\Page)))
             string))
  3. Verify the mutation with self.exercise or evaluate it
    directly. The function returned T, T, and NIL for
    whitespace-only, empty, and non-whitespace inputs respectively.

  4. Run self.commit with the title Add whitespace string predicate.

  5. Observe the failure:

    Conversation 52X6kxF does not exist.
    
  6. Retry the same self.commit call. It fails with the same message.

Suggested Fix

The failure is caused by a test that is not isolated from the running
application. self.commit invokes asdf:test-system :autolith in the
active image. During
test-openai-compatible-provider-bare-auth-selection, the line
regarding main-dispatch '("auth") reaches
main--connect-application. Because *active-application* is the
live application, it calls application-reconnect instead of creating
a test application.

The test replaces configuration-create with a temporary test
configuration, but the retained live application contains conversation
52X6kxF. application-reconnect consequently attempts to load that
identifier from the temporary configuration and signals Conversation 52X6kxF does not exist.

The smallest fix is to dynamically bind *active-application* to
nil around the test's main-dispatch call. That makes
main--connect-application construct a new application using the test
configuration. The dynamic binding restores the real application after
the test, so the test cannot replace or reconnect the active user
session.

A broader hardening change would run self.commit's full ASDF suite
in a disposable worker or subprocess. That isolates all tests from the
active agent's global state. The focused test fix should be applied
first because the test currently violates isolation even when invoked
by other in-process checks.

Add a regression case that runs the auth-selection test while a
distinct persisted application is dynamically active, then verifies
the test completes without loading that application's conversation
from the temporary test configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions