Skip to content

APISeex.cancel() always raises AttributeError: '_meseex_box' (attribute never assigned) #17

@luisfilipemed

Description

@luisfilipemed

Summary

job.cancel() on any APISeex job raises AttributeError: 'APISeex' object has no attribute '_meseex_box' — unconditionally, not a timing race. Retested live against fastsdk 0.2.31 + meseex 0.0.8.

Repro

import os
from socaity.sdk.replicate.black_forest_labs import flux_schnell
flux = flux_schnell(api_key=os.getenv('SOCAITY_API_KEY'))
job = flux(prompt='a neon city')
job.cancel()
File ".../fastsdk/service_interaction/api_seex.py", line 162, in cancel
    if self._meseex_box is None or self._api_client is None or self._response_parser is None:
AttributeError: 'APISeex' object has no attribute '_meseex_box'

Root cause

APISeex.cancel() and _run_async_call() reference self._meseex_box, but nothing ever assigns it:

  • meseex 0.0.8 never sets _meseex_box anywhere (grepped the whole package); MrMeseex.__init__ does not initialize it.
  • MeseexBox.summon_meseex() (the attach point) only sets meseex._cancel_handler = self.cancel_meseex — it does not set a box back-reference.
  • So self._meseex_box resolves to nothing → AttributeError before the is None guard can help.

The working path is the base MrMeseex.cancel() (mr_meseex.py:403), which calls self._cancel_handler(self, ...) — and _cancel_handler is wired up by summon_meseex.

Suggested fixes (any one)

  1. In MeseexBox.summon_meseex(), set meseex._meseex_box = self.
  2. Initialize self._meseex_box = None in MrMeseex.__init__ (then the existing is None guard fires → its intended RuntimeError('not attached to a MeseexBox')).
  3. Have APISeex.cancel() fall back to super().cancel() (the _cancel_handler path) when _meseex_box is unavailable.

Impact

Cancellation is completely unavailable; docs (concepts/job-system) now carry a 'Known issue' caveat pointing users to get_result(timeout_s=...) until this is fixed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions